diff options
author | Theodore Ts'o <tytso@mit.edu> | 2009-03-28 10:59:57 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-03-28 10:59:57 -0400 |
commit | 06705bff9114531a997a7d0c2520bea0f2927410 (patch) | |
tree | f7bef499cd491c8171db45da5b02c168655d4236 /fs/ext4 | |
parent | e7c9e3e99adf6c49c5d593a51375916acc039d1e (diff) |
ext4: Regularize mount options
Add support for using the mount options "barrier" and "nobarrier", and
"auto_da_alloc" and "noauto_da_alloc", which is more consistent than
"barrier=<0|1>" or "auto_da_alloc=<0|1>". Most other ext3/ext4 mount
options use the foo/nofoo naming convention. We allow the old forms
of these mount options for backwards compatibility.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/super.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 45d07cf9df34..9987bba99db3 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -867,7 +867,7 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
867 | seq_puts(seq, ",data_err=abort"); | 867 | seq_puts(seq, ",data_err=abort"); |
868 | 868 | ||
869 | if (test_opt(sb, NO_AUTO_DA_ALLOC)) | 869 | if (test_opt(sb, NO_AUTO_DA_ALLOC)) |
870 | seq_puts(seq, ",auto_da_alloc=0"); | 870 | seq_puts(seq, ",noauto_da_alloc"); |
871 | 871 | ||
872 | ext4_show_quota_options(seq, sb); | 872 | ext4_show_quota_options(seq, sb); |
873 | return 0; | 873 | return 0; |
@@ -1018,7 +1018,7 @@ enum { | |||
1018 | Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic, Opt_err_ro, | 1018 | Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic, Opt_err_ro, |
1019 | Opt_nouid32, Opt_debug, Opt_oldalloc, Opt_orlov, | 1019 | Opt_nouid32, Opt_debug, Opt_oldalloc, Opt_orlov, |
1020 | Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, | 1020 | Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, |
1021 | Opt_auto_da_alloc, Opt_noload, Opt_nobh, Opt_bh, | 1021 | Opt_auto_da_alloc, Opt_noauto_da_alloc, Opt_noload, Opt_nobh, Opt_bh, |
1022 | Opt_commit, Opt_min_batch_time, Opt_max_batch_time, | 1022 | Opt_commit, Opt_min_batch_time, Opt_max_batch_time, |
1023 | Opt_journal_update, Opt_journal_dev, | 1023 | Opt_journal_update, Opt_journal_dev, |
1024 | Opt_journal_checksum, Opt_journal_async_commit, | 1024 | Opt_journal_checksum, Opt_journal_async_commit, |
@@ -1026,8 +1026,8 @@ enum { | |||
1026 | Opt_data_err_abort, Opt_data_err_ignore, | 1026 | Opt_data_err_abort, Opt_data_err_ignore, |
1027 | Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota, | 1027 | Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota, |
1028 | Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota, | 1028 | Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota, |
1029 | Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota, | 1029 | Opt_ignore, Opt_barrier, Opt_nobarrier, Opt_err, Opt_resize, |
1030 | Opt_grpquota, Opt_i_version, | 1030 | Opt_usrquota, Opt_grpquota, Opt_i_version, |
1031 | Opt_stripe, Opt_delalloc, Opt_nodelalloc, | 1031 | Opt_stripe, Opt_delalloc, Opt_nodelalloc, |
1032 | Opt_inode_readahead_blks, Opt_journal_ioprio | 1032 | Opt_inode_readahead_blks, Opt_journal_ioprio |
1033 | }; | 1033 | }; |
@@ -1080,6 +1080,8 @@ static const match_table_t tokens = { | |||
1080 | {Opt_quota, "quota"}, | 1080 | {Opt_quota, "quota"}, |
1081 | {Opt_usrquota, "usrquota"}, | 1081 | {Opt_usrquota, "usrquota"}, |
1082 | {Opt_barrier, "barrier=%u"}, | 1082 | {Opt_barrier, "barrier=%u"}, |
1083 | {Opt_barrier, "barrier"}, | ||
1084 | {Opt_nobarrier, "nobarrier"}, | ||
1083 | {Opt_i_version, "i_version"}, | 1085 | {Opt_i_version, "i_version"}, |
1084 | {Opt_stripe, "stripe=%u"}, | 1086 | {Opt_stripe, "stripe=%u"}, |
1085 | {Opt_resize, "resize"}, | 1087 | {Opt_resize, "resize"}, |
@@ -1088,6 +1090,8 @@ static const match_table_t tokens = { | |||
1088 | {Opt_inode_readahead_blks, "inode_readahead_blks=%u"}, | 1090 | {Opt_inode_readahead_blks, "inode_readahead_blks=%u"}, |
1089 | {Opt_journal_ioprio, "journal_ioprio=%u"}, | 1091 | {Opt_journal_ioprio, "journal_ioprio=%u"}, |
1090 | {Opt_auto_da_alloc, "auto_da_alloc=%u"}, | 1092 | {Opt_auto_da_alloc, "auto_da_alloc=%u"}, |
1093 | {Opt_auto_da_alloc, "auto_da_alloc"}, | ||
1094 | {Opt_noauto_da_alloc, "noauto_da_alloc"}, | ||
1091 | {Opt_err, NULL}, | 1095 | {Opt_err, NULL}, |
1092 | }; | 1096 | }; |
1093 | 1097 | ||
@@ -1422,9 +1426,14 @@ set_qf_format: | |||
1422 | case Opt_abort: | 1426 | case Opt_abort: |
1423 | set_opt(sbi->s_mount_opt, ABORT); | 1427 | set_opt(sbi->s_mount_opt, ABORT); |
1424 | break; | 1428 | break; |
1429 | case Opt_nobarrier: | ||
1430 | clear_opt(sbi->s_mount_opt, BARRIER); | ||
1431 | break; | ||
1425 | case Opt_barrier: | 1432 | case Opt_barrier: |
1426 | if (match_int(&args[0], &option)) | 1433 | if (match_int(&args[0], &option)) { |
1427 | return 0; | 1434 | set_opt(sbi->s_mount_opt, BARRIER); |
1435 | break; | ||
1436 | } | ||
1428 | if (option) | 1437 | if (option) |
1429 | set_opt(sbi->s_mount_opt, BARRIER); | 1438 | set_opt(sbi->s_mount_opt, BARRIER); |
1430 | else | 1439 | else |
@@ -1485,9 +1494,14 @@ set_qf_format: | |||
1485 | *journal_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, | 1494 | *journal_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, |
1486 | option); | 1495 | option); |
1487 | break; | 1496 | break; |
1497 | case Opt_noauto_da_alloc: | ||
1498 | set_opt(sbi->s_mount_opt,NO_AUTO_DA_ALLOC); | ||
1499 | break; | ||
1488 | case Opt_auto_da_alloc: | 1500 | case Opt_auto_da_alloc: |
1489 | if (match_int(&args[0], &option)) | 1501 | if (match_int(&args[0], &option)) { |
1490 | return 0; | 1502 | clear_opt(sbi->s_mount_opt, NO_AUTO_DA_ALLOC); |
1503 | break; | ||
1504 | } | ||
1491 | if (option) | 1505 | if (option) |
1492 | clear_opt(sbi->s_mount_opt, NO_AUTO_DA_ALLOC); | 1506 | clear_opt(sbi->s_mount_opt, NO_AUTO_DA_ALLOC); |
1493 | else | 1507 | else |