1 ext4: trivial mount flags manipulation cleanup
3 Patch simply replace intermediate EXT4_MOUNT_XXX flags manipulation to
5 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
6 index 312211e..6459bb7 100644
9 @@ -775,10 +775,10 @@ static inline void ext4_show_quota_options(struct seq_file *seq,
10 if (sbi->s_qf_names[GRPQUOTA])
11 seq_printf(seq, ",grpjquota=%s", sbi->s_qf_names[GRPQUOTA]);
13 - if (sbi->s_mount_opt & EXT4_MOUNT_USRQUOTA)
14 + if (test_opt(sb, USRQUOTA))
15 seq_puts(seq, ",usrquota");
17 - if (sbi->s_mount_opt & EXT4_MOUNT_GRPQUOTA)
18 + if (test_opt(sb, GRPQUOTA))
19 seq_puts(seq, ",grpquota");
22 @@ -1342,14 +1342,13 @@ static int parse_options(char *options, struct super_block *sb,
23 data_opt = EXT4_MOUNT_WRITEBACK_DATA;
26 - if ((sbi->s_mount_opt & EXT4_MOUNT_DATA_FLAGS)
28 + if (test_opt(sb, DATA_FLAGS) != data_opt) {
29 ext4_msg(sb, KERN_ERR,
30 "Cannot change data mode on remount");
34 - sbi->s_mount_opt &= ~EXT4_MOUNT_DATA_FLAGS;
35 + clear_opt(sbi->s_mount_opt, DATA_FLAGS);
36 sbi->s_mount_opt |= data_opt;
39 @@ -1572,18 +1571,14 @@ set_qf_format:
42 if (sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) {
43 - if ((sbi->s_mount_opt & EXT4_MOUNT_USRQUOTA) &&
44 - sbi->s_qf_names[USRQUOTA])
45 + if (test_opt(sb, USRQUOTA) && sbi->s_qf_names[USRQUOTA])
46 clear_opt(sbi->s_mount_opt, USRQUOTA);
48 - if ((sbi->s_mount_opt & EXT4_MOUNT_GRPQUOTA) &&
49 - sbi->s_qf_names[GRPQUOTA])
50 + if (test_opt(sb, GRPQUOTA) && sbi->s_qf_names[GRPQUOTA])
51 clear_opt(sbi->s_mount_opt, GRPQUOTA);
53 - if ((sbi->s_qf_names[USRQUOTA] &&
54 - (sbi->s_mount_opt & EXT4_MOUNT_GRPQUOTA)) ||
55 - (sbi->s_qf_names[GRPQUOTA] &&
56 - (sbi->s_mount_opt & EXT4_MOUNT_USRQUOTA))) {
57 + if ((sbi->s_qf_names[USRQUOTA] && test_opt(sb, GRPQUOTA)) ||
58 + (sbi->s_qf_names[GRPQUOTA] && test_opt(sb, USRQUOTA))) {
59 ext4_msg(sb, KERN_ERR, "old and new quota "
62 @@ -2402,11 +2397,11 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
63 set_opt(sbi->s_mount_opt, POSIX_ACL);
65 if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_DATA)
66 - sbi->s_mount_opt |= EXT4_MOUNT_JOURNAL_DATA;
67 + set_opt(sbi->s_mount_opt, JOURNAL_DATA);
68 else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_ORDERED)
69 - sbi->s_mount_opt |= EXT4_MOUNT_ORDERED_DATA;
70 + set_opt(sbi->s_mount_opt, ORDERED_DATA);
71 else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_WBACK)
72 - sbi->s_mount_opt |= EXT4_MOUNT_WRITEBACK_DATA;
73 + set_opt(sbi->s_mount_opt, WRITEBACK_DATA);
75 if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_PANIC)
76 set_opt(sbi->s_mount_opt, ERRORS_PANIC);
77 @@ -2434,7 +2429,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
80 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
81 - ((sbi->s_mount_opt & EXT4_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
82 + (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0);
84 if (le32_to_cpu(es->s_rev_level) == EXT4_GOOD_OLD_REV &&
85 (EXT4_HAS_COMPAT_FEATURE(sb, ~0U) ||
86 @@ -3485,7 +3480,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
87 ext4_abort(sb, __func__, "Abort forced by user");
89 sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
90 - ((sbi->s_mount_opt & EXT4_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
91 + (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0);