Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Heming Zhao and committed by
Andrew Morton
52535022 f51dac02

+1 -1
+1 -1
fs/ocfs2/suballoc.c
··· 2006 2006 for (i = 0; i < le16_to_cpu(cl->cl_next_free_rec); i ++) { 2007 2007 if (i == victim) 2008 2008 continue; 2009 - if (!cl->cl_recs[i].c_free) 2009 + if (le32_to_cpu(cl->cl_recs[i].c_free) < bits_wanted) 2010 2010 continue; 2011 2011 2012 2012 ac->ac_chain = i;