Skip to content

Commit 5253502

Browse files
zhaohemakpm00
authored andcommitted
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]>
1 parent f51dac0 commit 5253502

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ocfs2/suballoc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2006,7 +2006,7 @@ static int ocfs2_claim_suballoc_bits(struct ocfs2_alloc_context *ac,
20062006
for (i = 0; i < le16_to_cpu(cl->cl_next_free_rec); i ++) {
20072007
if (i == victim)
20082008
continue;
2009-
if (!cl->cl_recs[i].c_free)
2009+
if (le32_to_cpu(cl->cl_recs[i].c_free) < bits_wanted)
20102010
continue;
20112011

20122012
ac->ac_chain = i;

0 commit comments

Comments
 (0)