Skip to content

Commit 90c5ce3

Browse files
wangzijieJaegeuk Kim
authored andcommitted
f2fs: convert F2FS_I_SB to sbi in f2fs_setattr()
Introduce sbi in f2fs_setattr() and convert F2FS_I_SB to it. No logic change, just cleanup and prepare to get CAP_BLKS_PER_SEC(sbi). Signed-off-by: wangzijie <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 1f13689 commit 90c5ce3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fs/f2fs/file.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,9 +1042,10 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
10421042
{
10431043
struct inode *inode = d_inode(dentry);
10441044
struct f2fs_inode_info *fi = F2FS_I(inode);
1045+
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
10451046
int err;
10461047

1047-
if (unlikely(f2fs_cp_error(F2FS_I_SB(inode))))
1048+
if (unlikely(f2fs_cp_error(sbi)))
10481049
return -EIO;
10491050

10501051
if (unlikely(IS_IMMUTABLE(inode)))
@@ -1084,12 +1085,11 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
10841085
}
10851086
if (i_uid_needs_update(idmap, attr, inode) ||
10861087
i_gid_needs_update(idmap, attr, inode)) {
1087-
f2fs_lock_op(F2FS_I_SB(inode));
1088+
f2fs_lock_op(sbi);
10881089
err = dquot_transfer(idmap, inode, attr);
10891090
if (err) {
1090-
set_sbi_flag(F2FS_I_SB(inode),
1091-
SBI_QUOTA_NEED_REPAIR);
1092-
f2fs_unlock_op(F2FS_I_SB(inode));
1091+
set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR);
1092+
f2fs_unlock_op(sbi);
10931093
return err;
10941094
}
10951095
/*
@@ -1099,7 +1099,7 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
10991099
i_uid_update(idmap, attr, inode);
11001100
i_gid_update(idmap, attr, inode);
11011101
f2fs_mark_inode_dirty_sync(inode, true);
1102-
f2fs_unlock_op(F2FS_I_SB(inode));
1102+
f2fs_unlock_op(sbi);
11031103
}
11041104

11051105
if (attr->ia_valid & ATTR_SIZE) {
@@ -1162,7 +1162,7 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
11621162
f2fs_mark_inode_dirty_sync(inode, true);
11631163

11641164
/* inode change will produce dirty node pages flushed by checkpoint */
1165-
f2fs_balance_fs(F2FS_I_SB(inode), true);
1165+
f2fs_balance_fs(sbi, true);
11661166

11671167
return err;
11681168
}

0 commit comments

Comments
 (0)