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]
Date: Thu, 1 Feb 2024 10:40:59 +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] mbcache: Simplify the allocation of slab caches

On Thu 01-02-24 17:34:26, 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>

Looks good. Feel free to add:

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

								Honza

> ---
>  fs/mbcache.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/mbcache.c b/fs/mbcache.c
> index 82aa7a35db26..fe2624e17253 100644
> --- a/fs/mbcache.c
> +++ b/fs/mbcache.c
> @@ -426,9 +426,8 @@ EXPORT_SYMBOL(mb_cache_destroy);
>  
>  static int __init mbcache_init(void)
>  {
> -	mb_entry_cache = kmem_cache_create("mbcache",
> -				sizeof(struct mb_cache_entry), 0,
> -				SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, NULL);
> +	mb_entry_cache = KMEM_CACHE(mb_cache_entry,
> +					 SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD);
>  	if (!mb_entry_cache)
>  		return -ENOMEM;
>  	return 0;
> -- 
> 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