]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
f2fs: avoid unnecessary sanity check on ckpt_valid_blocks
authorChao Yu <chao@kernel.org>
Mon, 15 Jun 2026 13:08:19 +0000 (21:08 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 22 Jun 2026 19:52:38 +0000 (19:52 +0000)
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 <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.c

index 993555042876463a7a16b6617d62f649304374e5..d71ddb3ee9184548f950864aadb073c8aa338ad4 100644 (file)
@@ -4773,10 +4773,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--;
@@ -5090,10 +5088,8 @@ init_discard_map_done:
        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)