diff options
author | Heming Zhao <heming.zhao@suse.com> | 2024-03-28 20:52:02 +0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-04-25 21:07:04 -0700 |
commit | 525350221beb55bc6795595443d4cdeecb68ebec (patch) | |
tree | 5a2653d4d2739a70f0386c42f12a7f1f5e39564b /fs/ocfs2 | |
parent | f51dac026f75863004ebfb7885cec98e6d3172bb (diff) | |
download | linux-stable-525350221beb55bc6795595443d4cdeecb68ebec.tar.gz linux-stable-525350221beb55bc6795595443d4cdeecb68ebec.tar.bz2 linux-stable-525350221beb55bc6795595443d4cdeecb68ebec.zip |
ocfs2: speed up chain-list searching
Add short-circuit code to speed up searching
Link: https://lkml.kernel.org/r/20240328125203.20892-4-heming.zhao@suse.com
Signed-off-by: Heming Zhao <heming.zhao@suse.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Gang He <ghe@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Mark Fasheh <mark@fasheh.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/suballoc.c | 2 |
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; |