[PATCH] f2fs: avoid needless inode updates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If i_size wan't change at all, we don't need to write inode during fsync.

Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
---
 fs/f2fs/f2fs.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 4b993961d81d..0d76b572484a 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -2267,11 +2267,11 @@ static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync)
 		spin_unlock(&sbi->inode_lock[DIRTY_META]);
 		return ret;
 	}
-	if (!is_inode_flag_set(inode, FI_AUTO_RECOVER) ||
-			file_keep_isize(inode) ||
-			i_size_read(inode) & PAGE_MASK)
-		return false;
-	return F2FS_I(inode)->last_disk_size == i_size_read(inode);
+	if (F2FS_I(inode)->last_disk_size == i_size_read(inode))
+		return true;
+
+	return is_inode_flag_set(inode, FI_AUTO_RECOVER) &&
+		!file_keep_isize(inode) && !(i_size_read(inode) & PAGE_MASK);
 }
 
 static inline int f2fs_readonly(struct super_block *sb)
-- 
2.14.0.rc1.383.gd1ce394fe2-goog




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux