Skip to content

Commit ccf3ff2

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: introduce F2FS_QUOTA_DEFAULT_FL for cleanup
This patch adds F2FS_QUOTA_DEFAULT_FL to include two default flags: F2FS_NOATIME_FL and F2FS_IMMUTABLE_FL, and use it to clean up codes. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 8bec7dd commit ccf3ff2

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

fs/f2fs/f2fs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2960,6 +2960,8 @@ static inline void f2fs_change_bit(unsigned int nr, char *addr)
29602960
#define F2FS_PROJINHERIT_FL 0x20000000 /* Create with parents projid */
29612961
#define F2FS_CASEFOLD_FL 0x40000000 /* Casefolded file */
29622962

2963+
#define F2FS_QUOTA_DEFAULT_FL (F2FS_NOATIME_FL | F2FS_IMMUTABLE_FL)
2964+
29632965
/* Flags that should be inherited by new inodes from their parent. */
29642966
#define F2FS_FL_INHERITED (F2FS_SYNC_FL | F2FS_NODUMP_FL | F2FS_NOATIME_FL | \
29652967
F2FS_DIRSYNC_FL | F2FS_PROJINHERIT_FL | \

fs/f2fs/super.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,7 +2768,7 @@ static int f2fs_quota_enable(struct super_block *sb, int type, int format_id,
27682768
{
27692769
struct inode *qf_inode;
27702770
unsigned long qf_inum;
2771-
unsigned long qf_flag = F2FS_NOATIME_FL | F2FS_IMMUTABLE_FL;
2771+
unsigned long qf_flag = F2FS_QUOTA_DEFAULT_FL;
27722772
int err;
27732773

27742774
BUG_ON(!f2fs_sb_has_quota_ino(F2FS_SB(sb)));
@@ -2945,7 +2945,7 @@ static int f2fs_quota_on(struct super_block *sb, int type, int format_id,
29452945
return err;
29462946

29472947
inode_lock(inode);
2948-
F2FS_I(inode)->i_flags |= F2FS_NOATIME_FL | F2FS_IMMUTABLE_FL;
2948+
F2FS_I(inode)->i_flags |= F2FS_QUOTA_DEFAULT_FL;
29492949
f2fs_set_inode_flags(inode);
29502950
inode_unlock(inode);
29512951
f2fs_mark_inode_dirty_sync(inode, false);
@@ -2970,7 +2970,7 @@ static int __f2fs_quota_off(struct super_block *sb, int type)
29702970
goto out_put;
29712971

29722972
inode_lock(inode);
2973-
F2FS_I(inode)->i_flags &= ~(F2FS_NOATIME_FL | F2FS_IMMUTABLE_FL);
2973+
F2FS_I(inode)->i_flags &= ~F2FS_QUOTA_DEFAULT_FL;
29742974
f2fs_set_inode_flags(inode);
29752975
inode_unlock(inode);
29762976
f2fs_mark_inode_dirty_sync(inode, false);

0 commit comments

Comments
 (0)