Commit 77041823 authored by Huang Ying's avatar Huang Ying Committed by Jaegeuk Kim

f2fs: use nm_i->next_scan_nid as default for next_free_nid

Now, if there is no free nid in nm_i->free_nid_list, 0 may be saved
into next_free_nid of checkpoint, this may cause useless scanning for
next mount.  nm_i->next_scan_nid should be a better default value than
0.
Signed-off-by: default avatarHuang, Ying <ying.huang@intel.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent c1ce1b02
...@@ -808,7 +808,8 @@ static void do_checkpoint(struct f2fs_sb_info *sbi, bool is_umount) ...@@ -808,7 +808,8 @@ static void do_checkpoint(struct f2fs_sb_info *sbi, bool is_umount)
{ {
struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi);
struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_WARM_NODE); struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_WARM_NODE);
nid_t last_nid = 0; struct f2fs_nm_info *nm_i = NM_I(sbi);
nid_t last_nid = nm_i->next_scan_nid;
block_t start_blk; block_t start_blk;
struct page *cp_page; struct page *cp_page;
unsigned int data_sum_blocks, orphan_blocks; unsigned int data_sum_blocks, orphan_blocks;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment