diff mbox series

NFS: Simplify the allocation of slab caches in nfs_init_nfspagecache

Message ID 20240205083801.437099-1-chentao@kylinos.cn (mailing list archive)
State New
Headers show
Series NFS: Simplify the allocation of slab caches in nfs_init_nfspagecache | expand

Commit Message

Kunwu Chan Feb. 5, 2024, 8:38 a.m. UTC
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/nfs/pagelist.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 6efb5068c116..f04cc3274fda 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -1561,10 +1561,7 @@  void nfs_pageio_stop_mirroring(struct nfs_pageio_descriptor *pgio)
 
 int __init nfs_init_nfspagecache(void)
 {
-	nfs_page_cachep = kmem_cache_create("nfs_page",
-					    sizeof(struct nfs_page),
-					    0, SLAB_HWCACHE_ALIGN,
-					    NULL);
+	nfs_page_cachep = KMEM_CACHE(nfs_page, SLAB_HWCACHE_ALIGN);
 	if (nfs_page_cachep == NULL)
 		return -ENOMEM;