Skip to contentSkip to conversation

i_version mount option

PATCH In review Jean noel Cordenner 2 participants 2 messages Jul 30, 2007 – Aug 3, 2007 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i_version mount option

hi,

This patch apply on the top of the ext4 git tree. It adds a mount option to enable i_version feature for ext4.

fs/ext4/super.c +5 -1
Index: linux-2.6.22-ext4/fs/ext4/super.c
===================================================================
@@ -736,7 +736,7 @@
 	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_noextents,
+	Opt_grpquota, Opt_extents, Opt_noextents, Opt_i_version,
 	Opt_delayed_alloc, Opt_nodelayed_alloc,
 };
 
@@ -793,6 +793,7 @@
 	{Opt_noextents, "noextents"},
 	{Opt_delayed_alloc, "delalloc"},
 	{Opt_nodelayed_alloc, "nodelalloc"},
+	{Opt_i_version, "i_version"},
 	{Opt_err, NULL},
 	{Opt_resize, "resize"},
 };
@@ -1144,6 +1145,9 @@
 		case Opt_noextents:
 			clear_opt (sbi->s_mount_opt, EXTENTS);
 			break;
+		case Opt_i_version:
+			clear_opt (sbi->s_mount_opt, I_VERSION);
+			break;
 		default:
 			printk (KERN_ERR
 				"EXT4-fs: Unrecognized mount option \"%s\" "
include/linux/ext4_fs.h +1 -0
Index: linux-2.6.22-ext4/include/linux/ext4_fs.h
===================================================================
@@ -489,6 +489,7 @@
 #define EXT4_MOUNT_JOURNAL_CHECKSUM	0x800000 /* Journal checksums */
 #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT	0x1000000 /* Journal Async Commit */
 #define EXT4_MOUNT_DELAYED_ALLOC	0x2000000/* Delayed allocation support*/
+#define EXT4_MOUNT_I_VERSION		0x4000000/* i_version support */
 
 /* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */
 #ifndef _LINUX_EXT2_FS_H
fs/ext4/inode.c +3 -1
Index: linux-2.6.22-ext4/fs/ext4/inode.c
===================================================================
@@ -3107,7 +3107,9 @@
 {
 	int err = 0;
 
-	inode->i_version++;
+	if (test_opt(inode->i_sb, I_VERSION))
+		inode->i_version++;
+
 	/* the do_update_inode consumes one bh->b_count */
 	get_bh(iloc->bh);
 
#1 lore raw
Quoted 5 lines · Jean noel Cordenner

hi,

This patch apply on the top of the ext4 git tree. It adds a mount option to enable i_version feature for ext4.

I think we should fix overwrite case first. Per lkml discussion, if we fix the overwrite case by updating the counter in file_update_time() all the time, then the concern is this will impact other filesystems that don't want inode versioning support.

I believe that's how leads to put this patch back (adding a mount option).

It's better to have a VFS level super block flag to indicating if the filesystem as inode versioning support or not.

Thanks
Mingming

Quoted 2 lines