Skip to contentSkip to conversation

f2fs: remove QUOTA flag setting in f2fs_set_qf_name()

PATCH In review Chengguang Xu 2 participants 3 messages Sep 27, 2018 – Sep 29, 2018 F2FS file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 f2fs: remove QUOTA flag setting in f2fs_set_qf_name()

Mount flag QUOTA is the same as flag USRQUOTA in f2fs, so should not set flag QUOTA in f2fs_set_qf_name().

---
 fs/f2fs/super.c | 1 -
 1 file changed, 1 deletion(-)
fs/f2fs/super.c +0 -1
index 896b885f504e..e2abd45c2cdd 100644
@@ -286,7 +286,6 @@ static int f2fs_set_qf_name(struct super_block *sb, int qtype,
 		goto errout;
 	}
 	F2FS_OPTION(sbi).s_qf_names[qtype] = qname;
-	set_opt(sbi, QUOTA);
 	return 0;
 errout:
 	kfree(qname);
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 f2fs: remove unnecessary mount optino flag 'QUOTA'

Code cleanup by removing unnecessary mount option
flag 'QUOTA'.

---
 fs/f2fs/f2fs.h  | 1 -
 fs/f2fs/super.c | 3 ---
 2 files changed, 4 deletions(-)
fs/f2fs/f2fs.h +0 -1
index abf925664d9c..58d3e40ee46c 100644
@@ -97,7 +97,6 @@ extern char *f2fs_fault_name[FAULT_MAX];
 #define F2FS_MOUNT_USRQUOTA		0x00080000
 #define F2FS_MOUNT_GRPQUOTA		0x00100000
 #define F2FS_MOUNT_PRJQUOTA		0x00200000
-#define F2FS_MOUNT_QUOTA		0x00400000
 #define F2FS_MOUNT_INLINE_XATTR_SIZE	0x00800000
 #define F2FS_MOUNT_RESERVE_ROOT		0x01000000
 
fs/f2fs/super.c +0 -3
index e2abd45c2cdd..74eb63e8a2fd 100644
@@ -680,7 +680,6 @@ static int parse_options(struct super_block *sb, char *options)
 			F2FS_OPTION(sbi).s_jquota_fmt = QFMT_VFS_V1;
 			break;
 		case Opt_noquota:
-			clear_opt(sbi, QUOTA);
 			clear_opt(sbi, USRQUOTA);
 			clear_opt(sbi, GRPQUOTA);
 			clear_opt(sbi, PRJQUOTA);
@@ -1345,8 +1344,6 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
 	}
 #endif
 #ifdef CONFIG_QUOTA
-	if (test_opt(sbi, QUOTA))
-		seq_puts(seq, ",quota");
 	if (test_opt(sbi, USRQUOTA))
 		seq_puts(seq, ",usrquota");
 	if (test_opt(sbi, GRPQUOTA))
Signature · 1 line
2.17.1
#2 lore raw
In reply to Chengguang Xu
Quoted 2 lines · Chengguang Xu

Mount flag QUOTA is the same as flag USRQUOTA in f2fs, so should not set flag QUOTA in f2fs_set_qf_name().

Those journalled quota codes were copied from ext4, I'm not sure, maybe there are some userspace tools replying on this mount option, for example, apps can check 'quota' mount option to know whether current filesystem support quota feature, can you check that?

Thanks,

Quoted 19 lines
---
 fs/f2fs/super.c | 1 -
 1 file changed, 1 deletion(-)
fs/f2fs/super.c +0 -1
index 896b885f504e..e2abd45c2cdd 100644
@@ -286,7 +286,6 @@ static int f2fs_set_qf_name(struct super_block *sb, int qtype,
 		goto errout;
 	}
 	F2FS_OPTION(sbi).s_qf_names[qtype] = qname;
-	set_opt(sbi, QUOTA);
 	return 0;
 errout:
 	kfree(qname);