aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Gondois <[email protected]>2024-01-04 17:49:35 +0100
committerAndrew Morton <[email protected]>2024-02-22 15:38:51 -0800
commitb20a229c28bee1aef063d1abc3e1fc036609b396 (patch)
tree9948a6d85da2503149470aa8075117b4320f8c78
parent3fa2601e4a1fe3ec8068f7bee41a13afa061f6ae (diff)
bcache: use of hlist_count_nodes()
Make use of the newly added hlist_count_nodes(). Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Pierre Gondois <[email protected]> Acked-by: Coly Li <[email protected]> Acked-by: Marco Elver <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Cc: Arve Hjønnevåg <[email protected]> Cc: Carlos Llamas <[email protected]> Cc: Christian Brauner <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Joel Fernandes (Google) <[email protected]> Cc: Kees Cook <[email protected]> Cc: Kent Overstreet <[email protected]> Cc: Martijn Coenen <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: Todd Kjos <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--drivers/md/bcache/sysfs.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index a438efb66069..6956beb55326 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -702,13 +702,7 @@ static unsigned int bch_cache_max_chain(struct cache_set *c)
for (h = c->bucket_hash;
h < c->bucket_hash + (1 << BUCKET_HASH_BITS);
h++) {
- unsigned int i = 0;
- struct hlist_node *p;
-
- hlist_for_each(p, h)
- i++;
-
- ret = max(ret, i);
+ ret = max(ret, hlist_count_nodes(h));
}
mutex_unlock(&c->bucket_lock);