diff options
author | Eric Sandeen <sandeen@redhat.com> | 2009-11-19 14:25:42 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-11-19 14:25:42 -0500 |
commit | 5328e635315734d42080de9a5a1ee87bf4cae0a4 (patch) | |
tree | 4952c04c9b1faec9a3c82a3743805efad05ed96e /fs/ext4/super.c | |
parent | 2bba702d4f88d7b010ec37e2527b552588404ae7 (diff) |
ext4: make trim/discard optional (and off by default)
It is anticipated that when sb_issue_discard starts doing
real work on trim-capable devices, we may see issues. Make
this mount-time optional, and default it to off until we know
that things are working out OK.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/super.c')
-rw-r--r-- | fs/ext4/super.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index f2d5ec77c1e9..2b382f6f80c1 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -899,6 +899,9 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
899 | if (test_opt(sb, NO_AUTO_DA_ALLOC)) | 899 | if (test_opt(sb, NO_AUTO_DA_ALLOC)) |
900 | seq_puts(seq, ",noauto_da_alloc"); | 900 | seq_puts(seq, ",noauto_da_alloc"); |
901 | 901 | ||
902 | if (test_opt(sb, DISCARD)) | ||
903 | seq_puts(seq, ",discard"); | ||
904 | |||
902 | ext4_show_quota_options(seq, sb); | 905 | ext4_show_quota_options(seq, sb); |
903 | 906 | ||
904 | return 0; | 907 | return 0; |
@@ -1079,7 +1082,8 @@ enum { | |||
1079 | Opt_usrquota, Opt_grpquota, Opt_i_version, | 1082 | Opt_usrquota, Opt_grpquota, Opt_i_version, |
1080 | Opt_stripe, Opt_delalloc, Opt_nodelalloc, | 1083 | Opt_stripe, Opt_delalloc, Opt_nodelalloc, |
1081 | Opt_block_validity, Opt_noblock_validity, | 1084 | Opt_block_validity, Opt_noblock_validity, |
1082 | Opt_inode_readahead_blks, Opt_journal_ioprio | 1085 | Opt_inode_readahead_blks, Opt_journal_ioprio, |
1086 | Opt_discard, Opt_nodiscard, | ||
1083 | }; | 1087 | }; |
1084 | 1088 | ||
1085 | static const match_table_t tokens = { | 1089 | static const match_table_t tokens = { |
@@ -1144,6 +1148,8 @@ static const match_table_t tokens = { | |||
1144 | {Opt_auto_da_alloc, "auto_da_alloc=%u"}, | 1148 | {Opt_auto_da_alloc, "auto_da_alloc=%u"}, |
1145 | {Opt_auto_da_alloc, "auto_da_alloc"}, | 1149 | {Opt_auto_da_alloc, "auto_da_alloc"}, |
1146 | {Opt_noauto_da_alloc, "noauto_da_alloc"}, | 1150 | {Opt_noauto_da_alloc, "noauto_da_alloc"}, |
1151 | {Opt_discard, "discard"}, | ||
1152 | {Opt_nodiscard, "nodiscard"}, | ||
1147 | {Opt_err, NULL}, | 1153 | {Opt_err, NULL}, |
1148 | }; | 1154 | }; |
1149 | 1155 | ||
@@ -1565,6 +1571,12 @@ set_qf_format: | |||
1565 | else | 1571 | else |
1566 | set_opt(sbi->s_mount_opt,NO_AUTO_DA_ALLOC); | 1572 | set_opt(sbi->s_mount_opt,NO_AUTO_DA_ALLOC); |
1567 | break; | 1573 | break; |
1574 | case Opt_discard: | ||
1575 | set_opt(sbi->s_mount_opt, DISCARD); | ||
1576 | break; | ||
1577 | case Opt_nodiscard: | ||
1578 | clear_opt(sbi->s_mount_opt, DISCARD); | ||
1579 | break; | ||
1568 | default: | 1580 | default: |
1569 | ext4_msg(sb, KERN_ERR, | 1581 | ext4_msg(sb, KERN_ERR, |
1570 | "Unrecognized mount option \"%s\" " | 1582 | "Unrecognized mount option \"%s\" " |