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 1/3] f2fs-tools: use 'IS_CUR_SEGNO()' to check if it is current segment
Date: Thu, 28 Sep 2023 03:20:49 -0600 [thread overview]
Message-ID: <c6c4f47e6048164218b18dd2e299faf9c9b0a3d7.1695890686.git.bo.wu@vivo.com> (raw)
In-Reply-To: <cover.1695890686.git.bo.wu@vivo.com>
Use IS_CUR_SEGNO() here can make code more concise and readable.
---
fsck/mount.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/fsck/mount.c b/fsck/mount.c
index df0314d..e4372cf 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -2532,16 +2532,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;
}
--
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 ` Wu Bo via Linux-f2fs-devel [this message]
2023-10-07 1:39 ` [f2fs-dev] [PATCH v2 1/3] f2fs-tools: use 'IS_CUR_SEGNO()' to check if it is current segment Chao Yu
2023-09-28 9:20 ` [f2fs-dev] [PATCH v2 2/3] f2fs-tools: skip not matched segment when finding free block Wu Bo via Linux-f2fs-devel
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=c6c4f47e6048164218b18dd2e299faf9c9b0a3d7.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).