summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-08-14 17:57:29 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2015-08-20 09:00:11 -0700
commit268344664603706b6f156548f9d7482665222f87 (patch)
tree3a461e1503184cd1a7e6b502e1a65b5b2d689df8 /fs
parent26d5859974bb817f7615be90199a8e82e3f0a0ed (diff)
downloadlinux-stable-268344664603706b6f156548f9d7482665222f87.tar.gz
linux-stable-268344664603706b6f156548f9d7482665222f87.tar.bz2
linux-stable-268344664603706b6f156548f9d7482665222f87.zip
f2fs: reuse nids more aggressively
If we can reuse nids as many as possible, we can mitigate producing obsolete node pages in the page cache. Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/node.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 6e10c2a08ec6..3cc32b8f8204 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -306,6 +306,10 @@ static void set_node_addr(struct f2fs_sb_info *sbi, struct node_info *ni,
if (nat_get_blkaddr(e) != NEW_ADDR && new_blkaddr == NULL_ADDR) {
unsigned char version = nat_get_version(e);
nat_set_version(e, inc_node_version(version));
+
+ /* in order to reuse the nid */
+ if (nm_i->next_scan_nid > ni->nid)
+ nm_i->next_scan_nid = ni->nid;
}
/* change address */