Skip to content

Commit 1e2462f

Browse files
Mingming Caotytso
authored andcommitted
ext4: Enable extents by default
Turn on extents feature by default in ext4 filesystem, to get wider testing of extents feature in ext4dev. This can be disabled using -o noextents. Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent 749269f commit 1e2462f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

fs/ext4/super.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ enum {
734734
Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
735735
Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
736736
Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
737-
Opt_grpquota, Opt_extents,
737+
Opt_grpquota, Opt_extents, Opt_noextents,
738738
};
739739

740740
static match_table_t tokens = {
@@ -785,6 +785,7 @@ static match_table_t tokens = {
785785
{Opt_usrquota, "usrquota"},
786786
{Opt_barrier, "barrier=%u"},
787787
{Opt_extents, "extents"},
788+
{Opt_noextents, "noextents"},
788789
{Opt_err, NULL},
789790
{Opt_resize, "resize"},
790791
};
@@ -1120,6 +1121,9 @@ static int parse_options (char *options, struct super_block *sb,
11201121
case Opt_extents:
11211122
set_opt (sbi->s_mount_opt, EXTENTS);
11221123
break;
1124+
case Opt_noextents:
1125+
clear_opt (sbi->s_mount_opt, EXTENTS);
1126+
break;
11231127
default:
11241128
printk (KERN_ERR
11251129
"EXT4-fs: Unrecognized mount option \"%s\" "
@@ -1551,6 +1555,12 @@ static int ext4_fill_super (struct super_block *sb, void *data, int silent)
15511555

15521556
set_opt(sbi->s_mount_opt, RESERVATION);
15531557

1558+
/*
1559+
* turn on extents feature by default in ext4 filesystem
1560+
* User -o noextents to turn it off
1561+
*/
1562+
set_opt(sbi->s_mount_opt, EXTENTS);
1563+
15541564
if (!parse_options ((char *) data, sb, &journal_inum, &journal_devnum,
15551565
NULL, 0))
15561566
goto failed_mount;

0 commit comments

Comments
 (0)