From: Wu Bo via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Jaegeuk Kim <jaegeuk@kernel.org>, Chao Yu <chao@kernel.org>
Cc: Wu Bo <wubo.oduw@gmail.com>, Wu Bo <bo.wu@vivo.com>,
linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH v2 2/3] f2fs-tools: skip not matched segment when finding free block
Date: Thu, 28 Sep 2023 03:20:50 -0600 [thread overview]
Message-ID: <ea4273b977dcd05522ffbe4c6d84d44ce202d0c7.1695890686.git.bo.wu@vivo.com> (raw)
In-Reply-To: <cover.1695890686.git.bo.wu@vivo.com>
If the segment type is not matched, goto next segment to save time.
---
fsck/mount.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fsck/mount.c b/fsck/mount.c
index e4372cf..098e73d 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -2852,8 +2852,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;
--
2.25.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2023-09-28 9:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 9:20 [f2fs-dev] [PATCH v2 0/3] f2fs-tools: cache free segments count to improve perfmance Wu Bo via Linux-f2fs-devel
2023-09-28 9:20 ` [f2fs-dev] [PATCH v2 1/3] f2fs-tools: use 'IS_CUR_SEGNO()' to check if it is current segment Wu Bo via Linux-f2fs-devel
2023-10-07 1:39 ` Chao Yu
2023-09-28 9:20 ` Wu Bo via Linux-f2fs-devel [this message]
2023-09-28 9:20 ` [f2fs-dev] [PATCH v2 3/3] f2fs-tools: cache free segments count to improve perfmance Wu Bo via Linux-f2fs-devel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ea4273b977dcd05522ffbe4c6d84d44ce202d0c7.1695890686.git.bo.wu@vivo.com \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=bo.wu@vivo.com \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=wubo.oduw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).