lkml.org 
[lkml]   [2024]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] xfs: Simplify the allocation of slab caches in xfs_attr_intent_init_cache
Date
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@kylinos.cn>
---
fs/xfs/libxfs/xfs_attr.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index 9976a00a73f9..c8e1c741701f 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -1530,9 +1530,7 @@ xfs_attr_namecheck(
int __init
xfs_attr_intent_init_cache(void)
{
- xfs_attr_intent_cache = kmem_cache_create("xfs_attr_intent",
- sizeof(struct xfs_attr_intent),
- 0, 0, NULL);
+ xfs_attr_intent_cache = KMEM_CACHE(xfs_attr_intent, 0);

return xfs_attr_intent_cache != NULL ? 0 : -ENOMEM;
}
--
2.39.2

\
 
 \ /
  Last update: 2024-05-27 14:47    [W:0.047 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site