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: <20240131111847.ujdhhab6wdebo6fn@quack3>
Date: Wed, 31 Jan 2024 12:18:47 +0100
From: Jan Kara <jack@...e.cz>
To: Kunwu Chan <chentao@...inos.cn>
Cc: miklos@...redi.hu, amir73il@...il.com, viro@...iv.linux.org.uk,
	brauner@...nel.org, jack@...e.cz, linux-fsdevel@...r.kernel.org,
	linux-unionfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fs: Use KMEM_CACHE instead of kmem_cache_create

On Wed 31-01-24 15:09:41, Kunwu Chan wrote:
> commit 0a31bd5f2bbb ("KMEM_CACHE(): simplify slab cache creation")
> introduces a new macro.
> 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>

Looks good. Feel free to add:

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

								Honza

> ---
>  fs/backing-file.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fs/backing-file.c b/fs/backing-file.c
> index a681f38d84d8..740185198db3 100644
> --- a/fs/backing-file.c
> +++ b/fs/backing-file.c
> @@ -325,9 +325,7 @@ EXPORT_SYMBOL_GPL(backing_file_mmap);
>  
>  static int __init backing_aio_init(void)
>  {
> -	backing_aio_cachep = kmem_cache_create("backing_aio",
> -					       sizeof(struct backing_aio),
> -					       0, SLAB_HWCACHE_ALIGN, NULL);
> +	backing_aio_cachep = KMEM_CACHE(backing_aio, SLAB_HWCACHE_ALIGN);
>  	if (!backing_aio_cachep)
>  		return -ENOMEM;
>  
> -- 
> 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