container quota patch queue v0.07
[ct-quota-pq.git] / ext4-cleanup
blob30824b72db60d9a606e922fad7bf6dd4dfcfd8cc
1 ext3: trivial mount flags manipulation cleanup
3 Patch simply replace intermediate EXT3_MOUNT_XXX flags manipulation to  
4 corresponding macro.
5 diff --git a/fs/ext3/super.c b/fs/ext3/super.c
6 index 7a520a8..3d2e0ce 100644
7 --- a/fs/ext3/super.c
8 +++ b/fs/ext3/super.c
9 @@ -169,7 +169,7 @@ static void ext3_handle_error(struct super_block *sb)
10         if (!test_opt (sb, ERRORS_CONT)) {
11                 journal_t *journal = EXT3_SB(sb)->s_journal;
13 -               EXT3_SB(sb)->s_mount_opt |= EXT3_MOUNT_ABORT;
14 +               set_opt(EXT3_SB(sb)->s_mount_opt, ABORT);
15                 if (journal)
16                         journal_abort(journal, -EIO);
17         }
18 @@ -285,7 +285,7 @@ void ext3_abort (struct super_block * sb, const char * function,
19         printk(KERN_CRIT "Remounting filesystem read-only\n");
20         EXT3_SB(sb)->s_mount_state |= EXT3_ERROR_FS;
21         sb->s_flags |= MS_RDONLY;
22 -       EXT3_SB(sb)->s_mount_opt |= EXT3_MOUNT_ABORT;
23 +       set_opt(EXT3_SB(sb)->s_mount_opt, ABORT);
24         if (EXT3_SB(sb)->s_journal)
25                 journal_abort(EXT3_SB(sb)->s_journal, -EIO);
26  }
27 @@ -535,10 +535,10 @@ static inline void ext3_show_quota_options(struct seq_file *seq, struct super_bl
28         if (sbi->s_qf_names[GRPQUOTA])
29                 seq_printf(seq, ",grpjquota=%s", sbi->s_qf_names[GRPQUOTA]);
31 -       if (sbi->s_mount_opt & EXT3_MOUNT_USRQUOTA)
32 +       if (test_opt(sb, USRQUOTA))
33                 seq_puts(seq, ",usrquota");
35 -       if (sbi->s_mount_opt & EXT3_MOUNT_GRPQUOTA)
36 +       if (test_opt(sb, GRPQUOTA))
37                 seq_puts(seq, ",grpquota");
38  #endif
39  }
40 @@ -629,8 +629,7 @@ static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
41         if (test_opt(sb, NOBH))
42                 seq_puts(seq, ",nobh");
44 -       seq_printf(seq, ",data=%s", data_mode_string(sbi->s_mount_opt &
45 -                                                    EXT3_MOUNT_DATA_FLAGS));
46 +       seq_printf(seq, ",data=%s", data_mode_string(test_opt(sb, DATA_FLAGS)));
47         if (test_opt(sb, DATA_ERR_ABORT))
48                 seq_puts(seq, ",data_err=abort");
50 @@ -1031,8 +1030,7 @@ static int parse_options (char *options, struct super_block *sb,
51                         data_opt = EXT3_MOUNT_WRITEBACK_DATA;
52                 datacheck:
53                         if (is_remount) {
54 -                               if ((sbi->s_mount_opt & EXT3_MOUNT_DATA_FLAGS)
55 -                                               == data_opt)
56 +                               if (test_opt(sb, DATA_FLAGS) == data_opt)
57                                         break;
58                                 printk(KERN_ERR
59                                         "EXT3-fs (device %s): Cannot change "
60 @@ -1040,12 +1038,12 @@ static int parse_options (char *options, struct super_block *sb,
61                                         "is mounted in data=%s mode and you "
62                                         "try to remount it in data=%s mode.\n",
63                                         sb->s_id,
64 -                                       data_mode_string(sbi->s_mount_opt &
65 -                                                       EXT3_MOUNT_DATA_FLAGS),
66 +                                       data_mode_string(
67 +                                               test_opt(sb, DATA_FLAGS)),
68                                         data_mode_string(data_opt));
69                                 return 0;
70                         } else {
71 -                               sbi->s_mount_opt &= ~EXT3_MOUNT_DATA_FLAGS;
72 +                               clear_opt(sbi->s_mount_opt, DATA_FLAGS);
73                                 sbi->s_mount_opt |= data_opt;
74                         }
75                         break;
76 @@ -1206,18 +1204,14 @@ set_qf_format:
77         }
78  #ifdef CONFIG_QUOTA
79         if (sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) {
80 -               if ((sbi->s_mount_opt & EXT3_MOUNT_USRQUOTA) &&
81 -                    sbi->s_qf_names[USRQUOTA])
82 +               if (test_opt(sb, USRQUOTA) && sbi->s_qf_names[USRQUOTA])
83                         clear_opt(sbi->s_mount_opt, USRQUOTA);
85 -               if ((sbi->s_mount_opt & EXT3_MOUNT_GRPQUOTA) &&
86 -                    sbi->s_qf_names[GRPQUOTA])
87 +               if (test_opt(sb, GRPQUOTA) && sbi->s_qf_names[GRPQUOTA])
88                         clear_opt(sbi->s_mount_opt, GRPQUOTA);
90 -               if ((sbi->s_qf_names[USRQUOTA] &&
91 -                               (sbi->s_mount_opt & EXT3_MOUNT_GRPQUOTA)) ||
92 -                   (sbi->s_qf_names[GRPQUOTA] &&
93 -                               (sbi->s_mount_opt & EXT3_MOUNT_USRQUOTA))) {
94 +               if ((sbi->s_qf_names[USRQUOTA] && test_opt(sb, GRPQUOTA)) ||
95 +                   (sbi->s_qf_names[GRPQUOTA] && test_opt(sb, USRQUOTA))) {
96                         printk(KERN_ERR "EXT3-fs: old and new quota "
97                                         "format mixing.\n");
98                         return 0;
99 @@ -1634,11 +1628,11 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
100                 set_opt(sbi->s_mount_opt, POSIX_ACL);
101  #endif
102         if ((def_mount_opts & EXT3_DEFM_JMODE) == EXT3_DEFM_JMODE_DATA)
103 -               sbi->s_mount_opt |= EXT3_MOUNT_JOURNAL_DATA;
104 +               set_opt(sbi->s_mount_opt, JOURNAL_DATA);
105         else if ((def_mount_opts & EXT3_DEFM_JMODE) == EXT3_DEFM_JMODE_ORDERED)
106 -               sbi->s_mount_opt |= EXT3_MOUNT_ORDERED_DATA;
107 +               set_opt(sbi->s_mount_opt, ORDERED_DATA);
108         else if ((def_mount_opts & EXT3_DEFM_JMODE) == EXT3_DEFM_JMODE_WBACK)
109 -               sbi->s_mount_opt |= EXT3_MOUNT_WRITEBACK_DATA;
110 +               set_opt(sbi->s_mount_opt, WRITEBACK_DATA);
112         if (le16_to_cpu(sbi->s_es->s_errors) == EXT3_ERRORS_PANIC)
113                 set_opt(sbi->s_mount_opt, ERRORS_PANIC);
114 @@ -1657,7 +1651,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
115                 goto failed_mount;
117         sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
118 -               ((sbi->s_mount_opt & EXT3_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
119 +               (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0);
121         if (le32_to_cpu(es->s_rev_level) == EXT3_GOOD_OLD_REV &&
122             (EXT3_HAS_COMPAT_FEATURE(sb, ~0U) ||
123 @@ -2522,11 +2516,11 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
124                 goto restore_opts;
125         }
127 -       if (sbi->s_mount_opt & EXT3_MOUNT_ABORT)
128 +       if (test_opt(sb, ABORT))
129                 ext3_abort(sb, __func__, "Abort forced by user");
131         sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
132 -               ((sbi->s_mount_opt & EXT3_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
133 +               (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0);
135         es = sbi->s_es;
137 @@ -2534,7 +2528,7 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
139         if ((*flags & MS_RDONLY) != (sb->s_flags & MS_RDONLY) ||
140                 n_blocks_count > le32_to_cpu(es->s_blocks_count)) {
141 -               if (sbi->s_mount_opt & EXT3_MOUNT_ABORT) {
142 +               if (test_opt(sb, ABORT)) {
143                         err = -EROFS;
144                         goto restore_opts;
145                 }