Skip to content

Commit d13732c

Browse files
Jia YangJaegeuk Kim
authored andcommitted
f2fs: remove unnecessary read for F2FS_FITS_IN_INODE
F2FS_FITS_IN_INODE only cares the type of f2fs inode, so there is no need to read node page of f2fs inode. Signed-off-by: Jia Yang <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 7f8e249 commit d13732c

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

fs/f2fs/file.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ int f2fs_getattr(struct user_namespace *mnt_userns, const struct path *path,
812812
{
813813
struct inode *inode = d_inode(path->dentry);
814814
struct f2fs_inode_info *fi = F2FS_I(inode);
815-
struct f2fs_inode *ri;
815+
struct f2fs_inode *ri = NULL;
816816
unsigned int flags;
817817

818818
if (f2fs_has_extra_attr(inode) &&
@@ -2999,7 +2999,7 @@ static int f2fs_ioc_setproject(struct inode *inode, __u32 projid)
29992999
{
30003000
struct f2fs_inode_info *fi = F2FS_I(inode);
30013001
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
3002-
struct page *ipage;
3002+
struct f2fs_inode *ri = NULL;
30033003
kprojid_t kprojid;
30043004
int err;
30053005

@@ -3023,17 +3023,8 @@ static int f2fs_ioc_setproject(struct inode *inode, __u32 projid)
30233023
if (IS_NOQUOTA(inode))
30243024
return err;
30253025

3026-
ipage = f2fs_get_node_page(sbi, inode->i_ino);
3027-
if (IS_ERR(ipage))
3028-
return PTR_ERR(ipage);
3029-
3030-
if (!F2FS_FITS_IN_INODE(F2FS_INODE(ipage), fi->i_extra_isize,
3031-
i_projid)) {
3032-
err = -EOVERFLOW;
3033-
f2fs_put_page(ipage, 1);
3034-
return err;
3035-
}
3036-
f2fs_put_page(ipage, 1);
3026+
if (!F2FS_FITS_IN_INODE(ri, fi->i_extra_isize, i_projid))
3027+
return -EOVERFLOW;
30373028

30383029
err = f2fs_dquot_initialize(inode);
30393030
if (err)

0 commit comments

Comments
 (0)