mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Kunwu Chan <chentao@kylinos.cn>
Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] buffer: Use KMEM_CACHE instead of kmem_cache_create()
Date: Tue, 16 Jan 2024 11:38:42 +0100	[thread overview]
Message-ID: <20240116103842.g2dxbqno2owkuaqt@quack3> (raw)
In-Reply-To: <20240116091137.92375-1-chentao@kylinos.cn>

On Tue 16-01-24 17:11:37, Kunwu Chan wrote:
> Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
> to simplify the creation of SLAB caches.
> 
> Signed-off-by: Kunwu Chan <chentao@kylinos.cn>

Sure. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/buffer.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/buffer.c b/fs/buffer.c
> index d3bcf601d3e5..9c8156cce9b7 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -3121,12 +3121,8 @@ void __init buffer_init(void)
>  	unsigned long nrpages;
>  	int ret;
>  
> -	bh_cachep = kmem_cache_create("buffer_head",
> -			sizeof(struct buffer_head), 0,
> -				(SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
> -				SLAB_MEM_SPREAD),
> -				NULL);
> -
> +	bh_cachep = KMEM_CACHE(buffer_head,
> +				SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD);
>  	/*
>  	 * Limit the bh occupancy to 10% of ZONE_NORMAL
>  	 */
> -- 
> 2.39.2
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2024-01-16 10:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-16  9:11 Kunwu Chan
2024-01-16 10:38 ` Jan Kara [this message]
2024-01-16 11:01 ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240116103842.g2dxbqno2owkuaqt@quack3 \
    --to=jack@suse.cz \
    --cc=brauner@kernel.org \
    --cc=chentao@kylinos.cn \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®