[PATCH] NFS: Simplify the allocation of slab caches in nfs_init_nfspagecache

From: Kunwu Chan
Date: Mon Feb 05 2024 - 03:38:36 EST


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@xxxxxxxxxx>
---
fs/nfs/pagelist.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

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;

--
2.39.2