]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
nfsd: Simplify the allocation of slab caches in nfsd_drc_slab_create
authorKunwu Chan <chentao@kylinos.cn>
Sun, 4 Feb 2024 03:28:21 +0000 (11:28 +0800)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 1 Mar 2024 14:12:24 +0000 (09:12 -0500)
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.
And change cache name from 'nfsd_drc' to 'nfsd_cacherep'.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfscache.c

index cfcc6ac8f255a89b1f9f0d6a6022e5037e74654d..ba9d326b3de647778b4377359bcaa0d8db204a73 100644 (file)
@@ -166,8 +166,7 @@ nfsd_reply_cache_free(struct nfsd_drc_bucket *b, struct nfsd_cacherep *rp,
 
 int nfsd_drc_slab_create(void)
 {
-       drc_slab = kmem_cache_create("nfsd_drc",
-                               sizeof(struct nfsd_cacherep), 0, 0, NULL);
+       drc_slab = KMEM_CACHE(nfsd_cacherep, 0);
        return drc_slab ? 0: -ENOMEM;
 }