summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorChao Yu2015-04-30 12:35:50 +0200
committerJaegeuk Kim2015-05-29 00:41:41 +0200
commitd5b692b786e1aea68d2c6737dd0abeebc1dad619 (patch)
tree994e30276ea39863112b4c47b8381344af882f4e /fs/f2fs/node.c
parentf2fs: remove unneeded f2fs_make_empty declaration (diff)
downloadkernel-qcow2-linux-d5b692b786e1aea68d2c6737dd0abeebc1dad619.tar.gz
kernel-qcow2-linux-d5b692b786e1aea68d2c6737dd0abeebc1dad619.tar.xz
kernel-qcow2-linux-d5b692b786e1aea68d2c6737dd0abeebc1dad619.zip
f2fs: do not re-lookup nat cache with same nid
In set_node_addr, we try to lookup cached nat entry of inode and then set flag in it. But previously in this function, we have already grabbed nat entry with current node id, if the node id is the same as the one of inode, we do not need to lookup it in cache again. So this patch adds condition judgment for reducing unneeded lookup. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 62982e671d18..771725650c0d 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -315,7 +315,8 @@ static void set_node_addr(struct f2fs_sb_info *sbi, struct node_info *ni,
__set_nat_cache_dirty(nm_i, e);
/* update fsync_mark if its inode nat entry is still alive */
- e = __lookup_nat_cache(nm_i, ni->ino);
+ if (ni->nid != ni->ino)
+ e = __lookup_nat_cache(nm_i, ni->ino);
if (e) {
if (fsync_done && ni->nid == ni->ino)
set_nat_flag(e, HAS_FSYNCED_INODE, true);