The calculation of sec->ckpt_valid_blocks are the same in both set_ckpt_valid_blocks() and sanity_check_valid_blocks(), so it doesn't necessary to call sanity_check_valid_blocks() right after set_ckpt_valid_blocks().
Signed-off-by: Chao Yu <[email protected]> --- fs/f2fs/segment.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 1ef4edb77078..f9c688d270e6 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -4802,10 +4802,8 @@ void f2fs_flush_sit_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc) } /* update ckpt_valid_block */ - if (__is_large_section(sbi)) { + if (__is_large_section(sbi)) set_ckpt_valid_blocks(sbi, segno); - sanity_check_valid_blocks(sbi, segno); - } __clear_bit(segno, bitmap); sit_i->dirty_sentries--; @@ -5133,10 +5131,8 @@ static int build_sit_entries(struct f2fs_sb_info *sbi) if (__is_large_section(sbi)) { unsigned int segno; - for (segno = 0; segno < MAIN_SEGS(sbi); segno += SEGS_PER_SEC(sbi)) { + for (segno = 0; segno < MAIN_SEGS(sbi); segno += SEGS_PER_SEC(sbi)) set_ckpt_valid_blocks(sbi, segno); - sanity_check_valid_blocks(sbi, segno); - } } if (err) -- 2.49.0 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
