[PATCH] Get rid of extents mount option - try 2

Dave Kleikamp
2006-10-06T21:21:45Z

I rushed that out too quick. This one cleans up the header files too.

EXT4: Get rid of extents mount option

Enabling an ext4 file system to use extents should be done with
'tune2fs -O extents' or 'mke2fs -O extents', not with a mount option

Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>

diff -Nurp linux-orig/fs/ext4/extents.c linux/fs/ext4/extents.c
--- linux-orig/fs/ext4/extents.c 2006-10-05 07:39:08.000000000 -0500
+++ linux/fs/ext4/extents.c 2006-10-06 15:45:59.000000000 -0500
@@ -1875,7 +1875,7 @@ void ext4_ext_init(struct super_block *s
* possible initialization would be here
*/

- if (test_opt(sb, EXTENTS)) {
+ if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
printk("EXT4-fs: file extents enabled");
#ifdef AGRESSIVE_TEST
printk(", agressive tests");
@@ -1900,7 +1900,7 @@ void ext4_ext_init(struct super_block *s
*/
void ext4_ext_release(struct super_block *sb)
{
- if (!test_opt(sb, EXTENTS))
+ if (!EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS))
return;

#ifdef EXTENTS_STATS
diff -Nurp linux-orig/fs/ext4/ialloc.c linux/fs/ext4/ialloc.c
--- linux-orig/fs/ext4/ialloc.c 2006-10-05 07:39:08.000000000 -0500
+++ linux/fs/ext4/ialloc.c 2006-10-06 15:37:36.000000000 -0500
@@ -618,16 +618,9 @@ got:
ext4_std_error(sb, err);
goto fail_free_drop;
}
- if (test_opt(sb, EXTENTS)) {
+ if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
EXT4_I(inode)->i_flags |= EXT4_EXTENTS_FL;
ext4_ext_tree_init(handle, inode);
- if (!EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS)) {
- err = ext4_journal_get_write_access(handle, EXT4_SB(sb)->s_sbh);
- if (err) goto fail;
- EXT4_SET_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS);
- BUFFER_TRACE(EXT4_SB(sb)->s_sbh, "call ext4_journal_dirty_metadata");
- err = ext4_journal_dirty_metadata(handle, EXT4_SB(sb)->s_sbh);
- }
}

ext4_debug("allocating inode %lu\n", inode->i_ino);
diff -Nurp linux-orig/fs/ext4/super.c linux/fs/ext4/super.c
--- linux-orig/fs/ext4/super.c 2006-10-05 07:39:08.000000000 -0500
+++ linux/fs/ext4/super.c 2006-10-06 15:47:47.000000000 -0500
@@ -728,7 +728,7 @@ enum {
Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
- Opt_grpquota, Opt_extents,
+ Opt_grpquota,
};

static match_table_t tokens = {
@@ -778,7 +778,6 @@ static match_table_t tokens = {
{Opt_quota, "quota"},
{Opt_usrquota, "usrquota"},
{Opt_barrier, "barrier=%u"},
- {Opt_extents, "extents"},
{Opt_err, NULL},
{Opt_resize, "resize"},
};
@@ -1111,9 +1110,6 @@ clear_qf_name:
case Opt_bh:
clear_opt(sbi->s_mount_opt, NOBH);
break;
- case Opt_extents:
- set_opt (sbi->s_mount_opt, EXTENTS);
- break;
default:
printk (KERN_ERR
"EXT4-fs: Unrecognized mount option \"%s\" "
diff -Nurp linux-orig/include/linux/ext4_fs.h linux/include/linux/ext4_fs.h
--- linux-orig/include/linux/ext4_fs.h 2006-10-05 07:39:08.000000000 -0500
+++ linux/include/linux/ext4_fs.h 2006-10-06 16:13:07.000000000 -0500
@@ -399,7 +399,6 @@ struct ext4_inode {
#define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */
#define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */
#define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */
-#define EXT4_MOUNT_EXTENTS 0x400000 /* Extents support */

/* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */
#ifndef _LINUX_EXT2_FS_H
diff -Nurp linux-orig/include/linux/ext4_jbd2.h linux/include/linux/ext4_jbd2.h
--- linux-orig/include/linux/ext4_jbd2.h 2006-10-05 07:39:08.000000000 -0500
+++ linux/include/linux/ext4_jbd2.h 2006-10-06 16:17:20.000000000 -0500
@@ -33,7 +33,7 @@

#define EXT4_SINGLEDATA_TRANS_BLOCKS(sb) \
(EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS) \
- || test_opt(sb, EXTENTS) ? 27U : 8U)
+ ? 27U : 8U)

/* Extended attribute operations touch at most two data buffers,
* two bitmap buffers, and two group summaries, in addition to the inode

--
David Kleikamp
IBM Linux Technology Center