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-next>] [day] [month] [year] [list]
Message-Id: <20240205081022.433945-1-chentao@kylinos.cn>
Date: Mon,  5 Feb 2024 16:10:22 +0800
From: Kunwu Chan <chentao@...inos.cn>
To: dlemoal@...nel.org,
	naohiro.aota@....com,
	jth@...nel.org
Cc: linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Kunwu Chan <chentao@...inos.cn>
Subject: [PATCH] zonefs: Simplify the allocation of slab caches in zonefs_init_inodecache

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>
---
 fs/zonefs/super.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index 93971742613a..9b578e7007e9 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -1387,10 +1387,8 @@ static struct file_system_type zonefs_type = {
 
 static int __init zonefs_init_inodecache(void)
 {
-	zonefs_inode_cachep = kmem_cache_create("zonefs_inode_cache",
-			sizeof(struct zonefs_inode_info), 0,
-			(SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD | SLAB_ACCOUNT),
-			NULL);
+	zonefs_inode_cachep = KMEM_CACHE(zonefs_inode_info,
+			SLAB_RECLAIM_ACCOUNT | SLAB_MEM_SPREAD | SLAB_ACCOUNT);
 	if (zonefs_inode_cachep == NULL)
 		return -ENOMEM;
 	return 0;
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ