Commit b20a229c authored by Pierre Gondois's avatar Pierre Gondois Committed by Andrew Morton

bcache: use of hlist_count_nodes()

Make use of the newly added hlist_count_nodes().

Link: https://lkml.kernel.org/r/20240104164937.424320-4-pierre.gondois@arm.comSigned-off-by: default avatarPierre Gondois <pierre.gondois@arm.com>
Acked-by: default avatarColy Li <colyli@suse.de>
Acked-by: default avatarMarco Elver <elver@google.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Carlos Llamas <cmllamas@google.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Joel Fernandes (Google) <joel@joelfernandes.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Cc: Martijn Coenen <maco@android.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Todd Kjos <tkjos@android.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 3fa2601e
...@@ -702,13 +702,7 @@ static unsigned int bch_cache_max_chain(struct cache_set *c) ...@@ -702,13 +702,7 @@ static unsigned int bch_cache_max_chain(struct cache_set *c)
for (h = c->bucket_hash; for (h = c->bucket_hash;
h < c->bucket_hash + (1 << BUCKET_HASH_BITS); h < c->bucket_hash + (1 << BUCKET_HASH_BITS);
h++) { h++) {
unsigned int i = 0; ret = max(ret, hlist_count_nodes(h));
struct hlist_node *p;
hlist_for_each(p, h)
i++;
ret = max(ret, i);
} }
mutex_unlock(&c->bucket_lock); mutex_unlock(&c->bucket_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment