Skip to content

Commit 2aad26f

Browse files
Chengguang Xujankara
authored andcommitted
ext2: remove redundant building macro check
If macro CONFIG_QUOTA is not enabled then mount option flag of usrquota/grpquota will not be set, so we can remove some building macro check safely in ext2_shwo_options(). Additionally, I think it's better to define EXT2_MOUNT_DAX regardless macro CONFIG_FS_DAX is enabled just like acl/xattr. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 1abefb0 commit 2aad26f

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

‎fs/ext2/ext2.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,7 @@ struct ext2_inode {
390390
#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */
391391
#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */
392392
#define EXT2_MOUNT_RESERVATION 0x080000 /* Preallocation */
393-
#ifdef CONFIG_FS_DAX
394393
#define EXT2_MOUNT_DAX 0x100000 /* Direct Access */
395-
#else
396-
#define EXT2_MOUNT_DAX 0
397-
#endif
398394

399395

400396
#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt

‎fs/ext2/super.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,20 +309,17 @@ static int ext2_show_options(struct seq_file *seq, struct dentry *root)
309309
if (test_opt(sb, NOBH))
310310
seq_puts(seq, ",nobh");
311311

312-
#if defined(CONFIG_QUOTA)
313312
if (sbi->s_mount_opt & EXT2_MOUNT_USRQUOTA)
314313
seq_puts(seq, ",usrquota");
315314

316315
if (sbi->s_mount_opt & EXT2_MOUNT_GRPQUOTA)
317316
seq_puts(seq, ",grpquota");
318-
#endif
319317

320-
#ifdef CONFIG_FS_DAX
321318
if (sbi->s_mount_opt & EXT2_MOUNT_XIP)
322319
seq_puts(seq, ",xip");
320+
323321
if (sbi->s_mount_opt & EXT2_MOUNT_DAX)
324322
seq_puts(seq, ",dax");
325-
#endif
326323

327324
if (!test_opt(sb, RESERVATION))
328325
seq_puts(seq, ",noreservation");

0 commit comments

Comments
 (0)