Skip to content

Commit 10bcc2f

Browse files
KunWuChanchucklever
authored andcommitted
nfsd: Simplify the allocation of slab caches in nfsd4_init_pnfs
commit 0a31bd5 ("KMEM_CACHE(): simplify slab cache creation") introduces a new macro. 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> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent 05eda6e commit 10bcc2f

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

fs/nfsd/nfs4layouts.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -777,13 +777,11 @@ nfsd4_init_pnfs(void)
777777
for (i = 0; i < DEVID_HASH_SIZE; i++)
778778
INIT_LIST_HEAD(&nfsd_devid_hash[i]);
779779

780-
nfs4_layout_cache = kmem_cache_create("nfs4_layout",
781-
sizeof(struct nfs4_layout), 0, 0, NULL);
780+
nfs4_layout_cache = KMEM_CACHE(nfs4_layout, 0);
782781
if (!nfs4_layout_cache)
783782
return -ENOMEM;
784783

785-
nfs4_layout_stateid_cache = kmem_cache_create("nfs4_layout_stateid",
786-
sizeof(struct nfs4_layout_stateid), 0, 0, NULL);
784+
nfs4_layout_stateid_cache = KMEM_CACHE(nfs4_layout_stateid, 0);
787785
if (!nfs4_layout_stateid_cache) {
788786
kmem_cache_destroy(nfs4_layout_cache);
789787
return -ENOMEM;

0 commit comments

Comments
 (0)