From: Huang Ying Date: Fri, 12 Sep 2014 12:19:48 +0000 (+0800) Subject: f2fs: use nm_i->next_scan_nid as default for next_free_nid X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7704182387f7eab6217a587420f8a3b3aa2d17d5;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Huang, Ying Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 5af7e3d1bb6e..d44d287cdae9 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -808,7 +808,8 @@ static void do_checkpoint(struct f2fs_sb_info *sbi, bool is_umount) { struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); 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; struct page *cp_page; unsigned int data_sum_blocks, orphan_blocks;