aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWu Bo <bo.wu@vivo.com>2023-09-28 03:20:50 -0600
committerJaegeuk Kim <jaegeuk@kernel.org>2023-10-02 08:33:20 -0700
commit91a95e9d90edf436c4346ecf1c893363e1feb573 (patch)
tree81f390c2f2a8554c5f7cd78fe75b6e6551fd847b
parent7dbf0cf9ec518e27f2a6a045621febe88e0b3028 (diff)
downloadf2fs-tools-91a95e9d90edf436c4346ecf1c893363e1feb573.tar.gz
f2fs-tools: skip not matched segment when finding free block
If the segment type is not matched, goto next segment to save time. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fsck/mount.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fsck/mount.c b/fsck/mount.c
index 9002a20..ed8f6e1 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -2977,8 +2977,10 @@ next_segment:
}
}
- if (type == want_type && !new_sec &&
- !f2fs_test_bit(offset, (const char *)bitmap))
+ if (type != want_type)
+ goto next_segment;
+ else if (!new_sec &&
+ !f2fs_test_bit(offset, (const char *)bitmap))
return 0;
*to = left ? *to - 1: *to + 1;