]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
nfsd: Simplify the allocation of slab caches in nfsd_file_cache_init
authorKunwu Chan <chentao@kylinos.cn>
Wed, 31 Jan 2024 06:56:53 +0000 (14:56 +0800)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 1 Mar 2024 14:12:23 +0000 (09:12 -0500)
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>
Acked-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/filecache.c

index 8d9f7b07e35b39bf5e9e392c9d98da10d2aaddb5..f3a642fd0ecaa834e8558b935284103651a204fc 100644 (file)
@@ -722,15 +722,13 @@ nfsd_file_cache_init(void)
                return ret;
 
        ret = -ENOMEM;
-       nfsd_file_slab = kmem_cache_create("nfsd_file",
-                               sizeof(struct nfsd_file), 0, 0, NULL);
+       nfsd_file_slab = KMEM_CACHE(nfsd_file, 0);
        if (!nfsd_file_slab) {
                pr_err("nfsd: unable to create nfsd_file_slab\n");
                goto out_err;
        }
 
-       nfsd_file_mark_slab = kmem_cache_create("nfsd_file_mark",
-                                       sizeof(struct nfsd_file_mark), 0, 0, NULL);
+       nfsd_file_mark_slab = KMEM_CACHE(nfsd_file_mark, 0);
        if (!nfsd_file_mark_slab) {
                pr_err("nfsd: unable to create nfsd_file_mark_slab\n");
                goto out_err;