Skip to content

Commit 2f74991

Browse files
KunWuChanchucklever
authored andcommitted
nfsd: Simplify the allocation of slab caches in nfsd_file_cache_init
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>
1 parent 10bcc2f commit 2f74991

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

fs/nfsd/filecache.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -722,15 +722,13 @@ nfsd_file_cache_init(void)
722722
return ret;
723723

724724
ret = -ENOMEM;
725-
nfsd_file_slab = kmem_cache_create("nfsd_file",
726-
sizeof(struct nfsd_file), 0, 0, NULL);
725+
nfsd_file_slab = KMEM_CACHE(nfsd_file, 0);
727726
if (!nfsd_file_slab) {
728727
pr_err("nfsd: unable to create nfsd_file_slab\n");
729728
goto out_err;
730729
}
731730

732-
nfsd_file_mark_slab = kmem_cache_create("nfsd_file_mark",
733-
sizeof(struct nfsd_file_mark), 0, 0, NULL);
731+
nfsd_file_mark_slab = KMEM_CACHE(nfsd_file_mark, 0);
734732
if (!nfsd_file_mark_slab) {
735733
pr_err("nfsd: unable to create nfsd_file_mark_slab\n");
736734
goto out_err;

0 commit comments

Comments
 (0)