mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 17:08:10 +00:00
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>
This commit is contained in:
parent
26d5859974
commit
2683446646
1 changed files with 4 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue