aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWu Bo <bo.wu@vivo.com>2023-09-28 03:20:49 -0600
committerJaegeuk Kim <jaegeuk@kernel.org>2023-10-02 08:33:02 -0700
commit7dbf0cf9ec518e27f2a6a045621febe88e0b3028 (patch)
tree68f79c0833ba715facea5a3a390fc6aed1856486
parent16a1226ddd5dfe1e8465f55447193c21fbb79c95 (diff)
downloadf2fs-tools-7dbf0cf9ec518e27f2a6a045621febe88e0b3028.tar.gz
f2fs-tools: use 'IS_CUR_SEGNO()' to check if it is current segment
Use IS_CUR_SEGNO() here can make code more concise and readable. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fsck/mount.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/fsck/mount.c b/fsck/mount.c
index e0a062b..9002a20 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -2654,16 +2654,8 @@ void build_sit_area_bitmap(struct f2fs_sb_info *sbi)
ptr += SIT_VBLOCK_MAP_SIZE;
if (se->valid_blocks == 0x0 && is_usable_seg(sbi, segno)) {
- if (le32_to_cpu(sbi->ckpt->cur_node_segno[0]) == segno ||
- le32_to_cpu(sbi->ckpt->cur_data_segno[0]) == segno ||
- le32_to_cpu(sbi->ckpt->cur_node_segno[1]) == segno ||
- le32_to_cpu(sbi->ckpt->cur_data_segno[1]) == segno ||
- le32_to_cpu(sbi->ckpt->cur_node_segno[2]) == segno ||
- le32_to_cpu(sbi->ckpt->cur_data_segno[2]) == segno) {
- continue;
- } else {
+ if (!IS_CUR_SEGNO(sbi, segno))
free_segs++;
- }
} else {
sum_vblocks += se->valid_blocks;
}