lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240116103842.g2dxbqno2owkuaqt@quack3>
Date: Tue, 16 Jan 2024 11:38:42 +0100
From: Jan Kara <jack@...e.cz>
To: Kunwu Chan <chentao@...inos.cn>
Cc: viro@...iv.linux.org.uk, brauner@...nel.org, jack@...e.cz,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] buffer: Use KMEM_CACHE instead of kmem_cache_create()

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@...inos.cn>

Sure. Feel free to add:

Reviewed-by: Jan Kara <jack@...e.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@...e.com>
SUSE Labs, CR

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ