lkml.org 
[lkml]   [2017]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] f2fs: avoid needless inode updates
Date
If i_size wan't change at all, we don't need to write inode during fsync.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
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
\
 
 \ /
  Last update: 2017-09-02 02:06    [W:0.030 / U:16.892 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site