aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeming Zhao <[email protected]>2024-03-28 20:52:02 +0800
committerAndrew Morton <[email protected]>2024-04-25 21:07:04 -0700
commit525350221beb55bc6795595443d4cdeecb68ebec (patch)
tree5a2653d4d2739a70f0386c42f12a7f1f5e39564b
parentf51dac026f75863004ebfb7885cec98e6d3172bb (diff)
ocfs2: speed up chain-list searching
Add short-circuit code to speed up searching Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Heming Zhao <[email protected]> Reviewed-by: Joseph Qi <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Gang He <[email protected]> Cc: Joel Becker <[email protected]> Cc: Jun Piao <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Mark Fasheh <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--fs/ocfs2/suballoc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index 8314ec487cfb..f7b483f0de2a 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -2006,7 +2006,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;