diff options
author | Dmitry Monakhov <dmonakhov@openvz.org> | 2010-02-24 11:35:32 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2010-02-24 11:35:32 -0500 |
commit | 482a74258fd08d30bf2ab0f5549afab5a5c9daba (patch) | |
tree | 6a1bae7df6861f7bdb7d21e1bab3385d352c92f7 /fs/ext4/super.c | |
parent | c8d46e41bc744c8fa0092112af3942fcd46c8b18 (diff) |
ext4: mount flags manipulation cleanup
Replace intermediate EXT4_MOUNT_XXX flags manipulation to
corresponding macro.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 1c85bb67e6eb..7e8b1b4236d3 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -796,10 +796,10 @@ static inline void ext4_show_quota_options(struct seq_file *seq, | |||
796 | if (sbi->s_qf_names[GRPQUOTA]) | 796 | if (sbi->s_qf_names[GRPQUOTA]) |
797 | seq_printf(seq, ",grpjquota=%s", sbi->s_qf_names[GRPQUOTA]); | 797 | seq_printf(seq, ",grpjquota=%s", sbi->s_qf_names[GRPQUOTA]); |
798 | 798 | ||
799 | if (sbi->s_mount_opt & EXT4_MOUNT_USRQUOTA) | 799 | if (test_opt(sb, USRQUOTA)) |
800 | seq_puts(seq, ",usrquota"); | 800 | seq_puts(seq, ",usrquota"); |
801 | 801 | ||
802 | if (sbi->s_mount_opt & EXT4_MOUNT_GRPQUOTA) | 802 | if (test_opt(sb, GRPQUOTA)) |
803 | seq_puts(seq, ",grpquota"); | 803 | seq_puts(seq, ",grpquota"); |
804 | #endif | 804 | #endif |
805 | } | 805 | } |
@@ -1383,14 +1383,13 @@ static int parse_options(char *options, struct super_block *sb, | |||
1383 | data_opt = EXT4_MOUNT_WRITEBACK_DATA; | 1383 | data_opt = EXT4_MOUNT_WRITEBACK_DATA; |
1384 | datacheck: | 1384 | datacheck: |
1385 | if (is_remount) { | 1385 | if (is_remount) { |
1386 | if ((sbi->s_mount_opt & EXT4_MOUNT_DATA_FLAGS) | 1386 | if (test_opt(sb, DATA_FLAGS) != data_opt) { |
1387 | != data_opt) { | ||
1388 | ext4_msg(sb, KERN_ERR, | 1387 | ext4_msg(sb, KERN_ERR, |
1389 | "Cannot change data mode on remount"); | 1388 | "Cannot change data mode on remount"); |
1390 | return 0; | 1389 | return 0; |
1391 | } | 1390 | } |
1392 | } else { | 1391 | } else { |
1393 | sbi->s_mount_opt &= ~EXT4_MOUNT_DATA_FLAGS; | 1392 | clear_opt(sbi->s_mount_opt, DATA_FLAGS); |
1394 | sbi->s_mount_opt |= data_opt; | 1393 | sbi->s_mount_opt |= data_opt; |
1395 | } | 1394 | } |
1396 | break; | 1395 | break; |
@@ -1625,18 +1624,14 @@ set_qf_format: | |||
1625 | } | 1624 | } |
1626 | #ifdef CONFIG_QUOTA | 1625 | #ifdef CONFIG_QUOTA |
1627 | if (sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) { | 1626 | if (sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) { |
1628 | if ((sbi->s_mount_opt & EXT4_MOUNT_USRQUOTA) && | 1627 | if (test_opt(sb, USRQUOTA) && sbi->s_qf_names[USRQUOTA]) |
1629 | sbi->s_qf_names[USRQUOTA]) | ||
1630 | clear_opt(sbi->s_mount_opt, USRQUOTA); | 1628 | clear_opt(sbi->s_mount_opt, USRQUOTA); |
1631 | 1629 | ||
1632 | if ((sbi->s_mount_opt & EXT4_MOUNT_GRPQUOTA) && | 1630 | if (test_opt(sb, GRPQUOTA) && sbi->s_qf_names[GRPQUOTA]) |
1633 | sbi->s_qf_names[GRPQUOTA]) | ||
1634 | clear_opt(sbi->s_mount_opt, GRPQUOTA); | 1631 | clear_opt(sbi->s_mount_opt, GRPQUOTA); |
1635 | 1632 | ||
1636 | if ((sbi->s_qf_names[USRQUOTA] && | 1633 | if ((sbi->s_qf_names[USRQUOTA] && test_opt(sb, GRPQUOTA)) || |
1637 | (sbi->s_mount_opt & EXT4_MOUNT_GRPQUOTA)) || | 1634 | (sbi->s_qf_names[GRPQUOTA] && test_opt(sb, USRQUOTA))) { |
1638 | (sbi->s_qf_names[GRPQUOTA] && | ||
1639 | (sbi->s_mount_opt & EXT4_MOUNT_USRQUOTA))) { | ||
1640 | ext4_msg(sb, KERN_ERR, "old and new quota " | 1635 | ext4_msg(sb, KERN_ERR, "old and new quota " |
1641 | "format mixing"); | 1636 | "format mixing"); |
1642 | return 0; | 1637 | return 0; |
@@ -2452,11 +2447,11 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
2452 | set_opt(sbi->s_mount_opt, POSIX_ACL); | 2447 | set_opt(sbi->s_mount_opt, POSIX_ACL); |
2453 | #endif | 2448 | #endif |
2454 | if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_DATA) | 2449 | if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_DATA) |
2455 | sbi->s_mount_opt |= EXT4_MOUNT_JOURNAL_DATA; | 2450 | set_opt(sbi->s_mount_opt, JOURNAL_DATA); |
2456 | else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_ORDERED) | 2451 | else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_ORDERED) |
2457 | sbi->s_mount_opt |= EXT4_MOUNT_ORDERED_DATA; | 2452 | set_opt(sbi->s_mount_opt, ORDERED_DATA); |
2458 | else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_WBACK) | 2453 | else if ((def_mount_opts & EXT4_DEFM_JMODE) == EXT4_DEFM_JMODE_WBACK) |
2459 | sbi->s_mount_opt |= EXT4_MOUNT_WRITEBACK_DATA; | 2454 | set_opt(sbi->s_mount_opt, WRITEBACK_DATA); |
2460 | 2455 | ||
2461 | if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_PANIC) | 2456 | if (le16_to_cpu(sbi->s_es->s_errors) == EXT4_ERRORS_PANIC) |
2462 | set_opt(sbi->s_mount_opt, ERRORS_PANIC); | 2457 | set_opt(sbi->s_mount_opt, ERRORS_PANIC); |
@@ -2484,7 +2479,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) | |||
2484 | goto failed_mount; | 2479 | goto failed_mount; |
2485 | 2480 | ||
2486 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | | 2481 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | |
2487 | ((sbi->s_mount_opt & EXT4_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); | 2482 | (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0); |
2488 | 2483 | ||
2489 | if (le32_to_cpu(es->s_rev_level) == EXT4_GOOD_OLD_REV && | 2484 | if (le32_to_cpu(es->s_rev_level) == EXT4_GOOD_OLD_REV && |
2490 | (EXT4_HAS_COMPAT_FEATURE(sb, ~0U) || | 2485 | (EXT4_HAS_COMPAT_FEATURE(sb, ~0U) || |
@@ -3520,7 +3515,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) | |||
3520 | ext4_abort(sb, __func__, "Abort forced by user"); | 3515 | ext4_abort(sb, __func__, "Abort forced by user"); |
3521 | 3516 | ||
3522 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | | 3517 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | |
3523 | ((sbi->s_mount_opt & EXT4_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); | 3518 | (test_opt(sb, POSIX_ACL) ? MS_POSIXACL : 0); |
3524 | 3519 | ||
3525 | es = sbi->s_es; | 3520 | es = sbi->s_es; |
3526 | 3521 | ||