aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2009-01-06 14:53:16 -0500
committerTheodore Ts'o <tytso@mit.edu>2009-01-06 14:53:16 -0500
commit83982b6f47201c4c7767210d24d7d8c99567a0b3 (patch)
treef1c19b1c6b5a34dd0c5de7519b78414b7a9267ee /fs
parent4d783b093cd4f3e2738527365979cbd1c5101065 (diff)
ext4: Remove "extents" mount option
This mount option is largely superfluous, and in fact the way it was implemented was buggy; if a filesystem which did not have the extents feature flag was mounted -o extents, the filesystem would attempt to create and use extents-based file even though the extents feature flag was not eabled. The simplest thing to do is to nuke the mount option entirely. It's not all that useful to force the non-creation of new extent-based files if the filesystem can support it. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/ext4.h1
-rw-r--r--fs/ext4/ext4_jbd2.h4
-rw-r--r--fs/ext4/extents.c4
-rw-r--r--fs/ext4/ialloc.c2
-rw-r--r--fs/ext4/migrate.c14
-rw-r--r--fs/ext4/super.c48
6 files changed, 14 insertions, 59 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 695b45cc34e7..db1718833f58 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -536,7 +536,6 @@ do { \
536#define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */ 536#define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */
537#define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ 537#define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */
538#define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ 538#define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */
539#define EXT4_MOUNT_EXTENTS 0x400000 /* Extents support */
540#define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */ 539#define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */
541#define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */ 540#define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */
542#define EXT4_MOUNT_I_VERSION 0x2000000 /* i_version support */ 541#define EXT4_MOUNT_I_VERSION 0x2000000 /* i_version support */
diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h
index 663197adae56..be2f426f6805 100644
--- a/fs/ext4/ext4_jbd2.h
+++ b/fs/ext4/ext4_jbd2.h
@@ -32,8 +32,8 @@
32 * 5 levels of tree + root which are stored in the inode. */ 32 * 5 levels of tree + root which are stored in the inode. */
33 33
34#define EXT4_SINGLEDATA_TRANS_BLOCKS(sb) \ 34#define EXT4_SINGLEDATA_TRANS_BLOCKS(sb) \
35 (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS) \ 35 (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS) \
36 || test_opt(sb, EXTENTS) ? 27U : 8U) 36 ? 27U : 8U)
37 37
38/* Extended attribute operations touch at most two data buffers, 38/* Extended attribute operations touch at most two data buffers,
39 * two bitmap buffers, and two group summaries, in addition to the inode 39 * two bitmap buffers, and two group summaries, in addition to the inode
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index c64080e49493..240cf0daad4b 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2247,7 +2247,7 @@ void ext4_ext_init(struct super_block *sb)
2247 * possible initialization would be here 2247 * possible initialization would be here
2248 */ 2248 */
2249 2249
2250 if (test_opt(sb, EXTENTS)) { 2250 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
2251 printk(KERN_INFO "EXT4-fs: file extents enabled"); 2251 printk(KERN_INFO "EXT4-fs: file extents enabled");
2252#ifdef AGGRESSIVE_TEST 2252#ifdef AGGRESSIVE_TEST
2253 printk(", aggressive tests"); 2253 printk(", aggressive tests");
@@ -2272,7 +2272,7 @@ void ext4_ext_init(struct super_block *sb)
2272 */ 2272 */
2273void ext4_ext_release(struct super_block *sb) 2273void ext4_ext_release(struct super_block *sb)
2274{ 2274{
2275 if (!test_opt(sb, EXTENTS)) 2275 if (!EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS))
2276 return; 2276 return;
2277 2277
2278#ifdef EXTENTS_STATS 2278#ifdef EXTENTS_STATS
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 369c34c64292..4fb86a0061d0 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -917,7 +917,7 @@ got:
917 if (err) 917 if (err)
918 goto fail_free_drop; 918 goto fail_free_drop;
919 919
920 if (test_opt(sb, EXTENTS)) { 920 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
921 /* set extent flag only for directory, file and normal symlink*/ 921 /* set extent flag only for directory, file and normal symlink*/
922 if (S_ISDIR(mode) || S_ISREG(mode) || S_ISLNK(mode)) { 922 if (S_ISDIR(mode) || S_ISREG(mode) || S_ISLNK(mode)) {
923 EXT4_I(inode)->i_flags |= EXT4_EXTENTS_FL; 923 EXT4_I(inode)->i_flags |= EXT4_EXTENTS_FL;
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c
index e7cd488da4bb..734abca25e35 100644
--- a/fs/ext4/migrate.c
+++ b/fs/ext4/migrate.c
@@ -459,13 +459,13 @@ int ext4_ext_migrate(struct inode *inode)
459 struct list_blocks_struct lb; 459 struct list_blocks_struct lb;
460 unsigned long max_entries; 460 unsigned long max_entries;
461 461
462 if (!test_opt(inode->i_sb, EXTENTS)) 462 /*
463 /* 463 * If the filesystem does not support extents, or the inode
464 * if mounted with noextents we don't allow the migrate 464 * already is extent-based, error out.
465 */ 465 */
466 return -EINVAL; 466 if (!EXT4_HAS_INCOMPAT_FEATURE(inode->i_sb,
467 467 EXT4_FEATURE_INCOMPAT_EXTENTS) ||
468 if ((EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) 468 (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL))
469 return -EINVAL; 469 return -EINVAL;
470 470
471 if (S_ISLNK(inode->i_mode) && inode->i_blocks == 0) 471 if (S_ISLNK(inode->i_mode) && inode->i_blocks == 0)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index b69d09203865..acb69c00fd42 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -829,8 +829,6 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs)
829 seq_puts(seq, ",journal_async_commit"); 829 seq_puts(seq, ",journal_async_commit");
830 if (test_opt(sb, NOBH)) 830 if (test_opt(sb, NOBH))
831 seq_puts(seq, ",nobh"); 831 seq_puts(seq, ",nobh");
832 if (!test_opt(sb, EXTENTS))
833 seq_puts(seq, ",noextents");
834 if (test_opt(sb, I_VERSION)) 832 if (test_opt(sb, I_VERSION))
835 seq_puts(seq, ",i_version"); 833 seq_puts(seq, ",i_version");
836 if (!test_opt(sb, DELALLOC)) 834 if (!test_opt(sb, DELALLOC))
@@ -1011,7 +1009,7 @@ enum {
1011 Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota, 1009 Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
1012 Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota, 1010 Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
1013 Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota, 1011 Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
1014 Opt_grpquota, Opt_extents, Opt_noextents, Opt_i_version, 1012 Opt_grpquota, Opt_i_version,
1015 Opt_stripe, Opt_delalloc, Opt_nodelalloc, 1013 Opt_stripe, Opt_delalloc, Opt_nodelalloc,
1016 Opt_inode_readahead_blks, Opt_journal_ioprio 1014 Opt_inode_readahead_blks, Opt_journal_ioprio
1017}; 1015};
@@ -1066,8 +1064,6 @@ static const match_table_t tokens = {
1066 {Opt_quota, "quota"}, 1064 {Opt_quota, "quota"},
1067 {Opt_usrquota, "usrquota"}, 1065 {Opt_usrquota, "usrquota"},
1068 {Opt_barrier, "barrier=%u"}, 1066 {Opt_barrier, "barrier=%u"},
1069 {Opt_extents, "extents"},
1070 {Opt_noextents, "noextents"},
1071 {Opt_i_version, "i_version"}, 1067 {Opt_i_version, "i_version"},
1072 {Opt_stripe, "stripe=%u"}, 1068 {Opt_stripe, "stripe=%u"},
1073 {Opt_resize, "resize"}, 1069 {Opt_resize, "resize"},
@@ -1115,7 +1111,6 @@ static int parse_options(char *options, struct super_block *sb,
1115 int qtype, qfmt; 1111 int qtype, qfmt;
1116 char *qname; 1112 char *qname;
1117#endif 1113#endif
1118 ext4_fsblk_t last_block;
1119 1114
1120 if (!options) 1115 if (!options)
1121 return 1; 1116 return 1;
@@ -1445,33 +1440,6 @@ set_qf_format:
1445 case Opt_bh: 1440 case Opt_bh:
1446 clear_opt(sbi->s_mount_opt, NOBH); 1441 clear_opt(sbi->s_mount_opt, NOBH);
1447 break; 1442 break;
1448 case Opt_extents:
1449 if (!EXT4_HAS_INCOMPAT_FEATURE(sb,
1450 EXT4_FEATURE_INCOMPAT_EXTENTS)) {
1451 ext4_warning(sb, __func__,
1452 "extents feature not enabled "
1453 "on this filesystem, use tune2fs");
1454 return 0;
1455 }
1456 set_opt(sbi->s_mount_opt, EXTENTS);
1457 break;
1458 case Opt_noextents:
1459 /*
1460 * When e2fsprogs support resizing an already existing
1461 * ext3 file system to greater than 2**32 we need to
1462 * add support to block allocator to handle growing
1463 * already existing block mapped inode so that blocks
1464 * allocated for them fall within 2**32
1465 */
1466 last_block = ext4_blocks_count(sbi->s_es) - 1;
1467 if (last_block > 0xffffffffULL) {
1468 printk(KERN_ERR "EXT4-fs: Filesystem too "
1469 "large to mount with "
1470 "-o noextents options\n");
1471 return 0;
1472 }
1473 clear_opt(sbi->s_mount_opt, EXTENTS);
1474 break;
1475 case Opt_i_version: 1443 case Opt_i_version:
1476 set_opt(sbi->s_mount_opt, I_VERSION); 1444 set_opt(sbi->s_mount_opt, I_VERSION);
1477 sb->s_flags |= MS_I_VERSION; 1445 sb->s_flags |= MS_I_VERSION;
@@ -2136,18 +2104,6 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
2136 set_opt(sbi->s_mount_opt, BARRIER); 2104 set_opt(sbi->s_mount_opt, BARRIER);
2137 2105
2138 /* 2106 /*
2139 * turn on extents feature by default in ext4 filesystem
2140 * only if feature flag already set by mkfs or tune2fs.
2141 * Use -o noextents to turn it off
2142 */
2143 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS))
2144 set_opt(sbi->s_mount_opt, EXTENTS);
2145 else
2146 ext4_warning(sb, __func__,
2147 "extents feature not enabled on this filesystem, "
2148 "use tune2fs.");
2149
2150 /*
2151 * enable delayed allocation by default 2107 * enable delayed allocation by default
2152 * Use -o nodelalloc to turn it off 2108 * Use -o nodelalloc to turn it off
2153 */ 2109 */
@@ -3825,7 +3781,7 @@ static void __exit exit_ext4_fs(void)
3825} 3781}
3826 3782
3827MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others"); 3783MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
3828MODULE_DESCRIPTION("Fourth Extended Filesystem with extents"); 3784MODULE_DESCRIPTION("Fourth Extended Filesystem");
3829MODULE_LICENSE("GPL"); 3785MODULE_LICENSE("GPL");
3830module_init(init_ext4_fs) 3786module_init(init_ext4_fs)
3831module_exit(exit_ext4_fs) 3787module_exit(exit_ext4_fs)