flush_sit_entries() is always called before write_checkpoint(). Since free_segs is counted in write_checkpoint, there is no need to do that in flush_sit_entries. Besides, the value of free_segs may be not correct if we skip uptodate seg_entries.
Signed-off-by: Sheng Yong <shengyo...@huawei.com> --- fsck/mount.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/fsck/mount.c b/fsck/mount.c index 68278c5..80a4849 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -1867,11 +1867,9 @@ void flush_journal_entries(struct f2fs_sb_info *sbi) void flush_sit_entries(struct f2fs_sb_info *sbi) { - struct f2fs_checkpoint *cp = F2FS_CKPT(sbi); struct sit_info *sit_i = SIT_I(sbi); struct f2fs_sit_block *sit_blk; unsigned int segno = 0; - u32 free_segs = 0; sit_blk = calloc(BLOCK_SZ, 1); ASSERT(sit_blk); @@ -1891,14 +1889,9 @@ void flush_sit_entries(struct f2fs_sb_info *sbi) sit->vblocks = cpu_to_le16((se->type << SIT_VBLOCKS_SHIFT) | se->valid_blocks); rewrite_current_sit_page(sbi, segno, sit_blk); - - if (se->valid_blocks == 0x0 && - !IS_CUR_SEGNO(sbi, segno, NO_CHECK_TYPE)) - free_segs++; } free(sit_blk); - set_cp(free_segment_count, free_segs); } int find_next_free_block(struct f2fs_sb_info *sbi, u64 *to, int left, int type) -- 2.17.1 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel