[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4myh2bosrpeom3aiwsdhlksly7l7k5fiabuwoblxr52k6dp5ua@xok4hlxudw23>
Date: Fri, 5 Jan 2024 14:55:18 +0800
From: Coly Li <colyli@...e.de>
To: Pierre Gondois <pierre.gondois@....com>
Cc: linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Arve Hjønnevåg <arve@...roid.com>,
Todd Kjos <tkjos@...roid.com>, Martijn Coenen <maco@...roid.com>,
Joel Fernandes <joel@...lfernandes.org>, Christian Brauner <brauner@...nel.org>,
Carlos Llamas <cmllamas@...gle.com>, Suren Baghdasaryan <surenb@...gle.com>,
Kent Overstreet <kent.overstreet@...il.com>, Marco Elver <elver@...gle.com>,
Kees Cook <keescook@...omium.org>, Lucas De Marchi <lucas.demarchi@...el.com>,
Ingo Molnar <mingo@...nel.org>, Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-bcache@...r.kernel.org
Subject: Re: [PATCH v2 3/3] bcache: Use of hlist_count_nodes()
On Thu, Jan 04, 2024 at 05:49:35PM +0100, Pierre Gondois wrote:
> Make use of the newly added hlist_count_nodes().
>
> Signed-off-by: Pierre Gondois <pierre.gondois@....com>
Acked-by: Coly Li <colyli@...e.de>
Thanks.
> ---
> drivers/md/bcache/sysfs.c | 8 +-------
> 1 file changed, 1 insertion(+), 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);
> --
> 2.25.1
>
>
--
Coly Li
Powered by blists - more mailing lists