public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: use KMEM_CACHE() to create xfs_defer_pending cache
@ 2024-02-29  8:33 kunwu.chan
  2024-02-29 16:00 ` Darrick J. Wong
  2024-02-29 23:26 ` Dave Chinner
  0 siblings, 2 replies; 4+ messages in thread
From: kunwu.chan @ 2024-02-29  8:33 UTC (permalink / raw)
  To: chandan.babu, djwong; +Cc: linux-xfs, linux-kernel, Kunwu Chan

From: Kunwu Chan <chentao@kylinos.cn>

Use the KMEM_CACHE() macro instead of kmem_cache_create() to simplify
the creation of SLAB caches when the default values are used.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
 fs/xfs/libxfs/xfs_defer.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c
index 66a17910d021..6d957fcc17f2 100644
--- a/fs/xfs/libxfs/xfs_defer.c
+++ b/fs/xfs/libxfs/xfs_defer.c
@@ -1143,9 +1143,7 @@ xfs_defer_resources_rele(
 static inline int __init
 xfs_defer_init_cache(void)
 {
-	xfs_defer_pending_cache = kmem_cache_create("xfs_defer_pending",
-			sizeof(struct xfs_defer_pending),
-			0, 0, NULL);
+	xfs_defer_pending_cache = KMEM_CACHE(xfs_defer_pending, 0);
 
 	return xfs_defer_pending_cache != NULL ? 0 : -ENOMEM;
 }
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-01  2:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-29  8:33 [PATCH] xfs: use KMEM_CACHE() to create xfs_defer_pending cache kunwu.chan
2024-02-29 16:00 ` Darrick J. Wong
2024-02-29 23:26 ` Dave Chinner
2024-03-01  2:02   ` Kunwu Chan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox