From: Heming Zhao <heming.zhao@suse.com>
To: joseph.qi@linux.alibaba.com
Cc: Heming Zhao <heming.zhao@suse.com>,
ocfs2-devel@lists.linux.dev, ailiop@suse.com
Subject: [PATCH v5 3/4] ocfs2: speed up chain-list searching
Date: Thu, 28 Mar 2024 16:29:42 +0800 [thread overview]
Message-ID: <20240328082943.20251-4-heming.zhao@suse.com> (raw)
In-Reply-To: <20240328082943.20251-1-heming.zhao@suse.com>
Add short-circuit code to speed up searching
Signed-off-by: Heming Zhao <heming.zhao@suse.com>
---
v5:
- split 'sparse warnings' fix to a separate patch
- amend the commit log according to patch change
v4: first version
---
fs/ocfs2/suballoc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index fc80cb3dbcd1..823e2ec38b2d 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -2008,7 +2008,7 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *ac,
for (i = 0; i < le16_to_cpu(cl->cl_next_free_rec); i ++) {
if (i == victim)
continue;
- if (!cl->cl_recs[i].c_free)
+ if (le32_to_cpu(cl->cl_recs[i].c_free) < bits_wanted)
continue;
ac->ac_chain = i;
--
2.35.3
next prev parent reply other threads:[~2024-03-28 8:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-28 8:29 [PATCH v5 0/4] improve write IO performance when fragmentation is high Heming Zhao
2024-03-28 8:29 ` [PATCH v5 1/4] ocfs2: " Heming Zhao
2024-03-28 8:47 ` Joseph Qi
2024-03-28 8:57 ` Joseph Qi
2024-03-28 8:29 ` [PATCH v5 2/4] ocfs2: adjust enabling place for la window Heming Zhao
2024-03-28 8:58 ` Joseph Qi
2024-03-28 8:29 ` Heming Zhao [this message]
2024-03-28 8:58 ` [PATCH v5 3/4] ocfs2: speed up chain-list searching Joseph Qi
2024-03-28 8:29 ` [PATCH v5 4/4] ocfs2: fix sparse warnings Heming Zhao
2024-03-28 9:01 ` Joseph Qi
2024-03-28 10:50 ` Heming Zhao
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=20240328082943.20251-4-heming.zhao@suse.com \
--to=heming.zhao@suse.com \
--cc=ailiop@suse.com \
--cc=joseph.qi@linux.alibaba.com \
--cc=ocfs2-devel@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.