Skip to contentSkip to conversation

f2fs: don't bother with inode->i_version

PATCH In review Jeff Layton 2 participants 2 messages Oct 30, 2017 – Nov 1, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: don't bother with inode->i_version

From: Jeff Layton <[email protected]>

f2fs does not set the SB_I_VERSION flag, so the i_version will never be incremented on write. It was recently changed to increment the i_version on a quota write, which isn't necessary here.

---
 fs/f2fs/super.c | 2 --
 1 file changed, 2 deletions(-)
fs/f2fs/super.c +0 -2
index 933c3d529e65..b3359158e7be 100644
@@ -618,7 +618,6 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)
 	init_once((void *) fi);
 
 	/* Initialize f2fs-specific inode info */
-	fi->vfs_inode.i_version = 1;
 	atomic_set(&fi->dirty_pages, 0);
 	fi->i_current_depth = 1;
 	fi->i_advise = 0;
@@ -1386,7 +1385,6 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type,
 
 	if (len == towrite)
 		return 0;
-	inode->i_version++;
 	inode->i_mtime = inode->i_ctime = current_time(inode);
 	f2fs_mark_inode_dirty_sync(inode, false);
 	return len - towrite;
Signature · 1 line
2.13.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jeff Layton

From: Jeff Layton <[email protected]>

f2fs does not set the SB_I_VERSION flag, so the i_version will never be incremented on write. It was recently changed to increment the i_version on a quota write, which isn't necessary here.

Thanks,

Quoted 18 lines
---
 fs/f2fs/super.c | 2 --
 1 file changed, 2 deletions(-)
fs/f2fs/super.c +0 -1
index 933c3d529e65..b3359158e7be 100644
@@ -618,7 +618,6 @@ static struct inode *f2fs_alloc_inode(struct super_block *sb)
 	init_once((void *) fi);
 
 	/* Initialize f2fs-specific inode info */
-	fi->vfs_inode.i_version = 1;
 	atomic_set(&fi->dirty_pages, 0);
 	fi->i_current_depth = 1;
 	fi->i_advise = 0;

fs/f2fs/super.c static ssize_t f2fs_quota_write(struct super_block *sb, int type, · line 1390

Quoted 7 lines
fs/f2fs/super.c +0 -1
@@ -1386,7 +1385,6 @@ static ssize_t f2fs_quota_write(struct super_block *sb, int type,
 
 	if (len == towrite)
 		return 0;
-	inode->i_version++;
 	inode->i_mtime = inode->i_ctime = current_time(inode);
 	f2fs_mark_inode_dirty_sync(inode, false);
 	return len - towrite;

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot