From: kunwu.chan@linux.dev
To: trond.myklebust@hammerspace.com, anna@kernel.org
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Kunwu Chan <chentao@kylinos.cn>
Subject: [PATCH] nfs: use KMEM_CACHE() to create nfs_commit_data cache
Date: Thu, 29 Feb 2024 17:41:12 +0800 [thread overview]
Message-ID: <20240229094112.1154644-1-kunwu.chan@linux.dev> (raw)
From: Kunwu Chan <chentao@kylinos.cn>
Use the KMEM_CACHE() macro instead of kmem_cache_create() to simplify
the creation of SLAB caches when the default values are used.
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
---
fs/nfs/write.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index bb79d3a886ae..6a75772d447f 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -2148,10 +2148,7 @@ int __init nfs_init_writepagecache(void)
if (nfs_wdata_mempool == NULL)
goto out_destroy_write_cache;
- nfs_cdata_cachep = kmem_cache_create("nfs_commit_data",
- sizeof(struct nfs_commit_data),
- 0, SLAB_HWCACHE_ALIGN,
- NULL);
+ nfs_cdata_cachep = KMEM_CACHE(nfs_commit_data, SLAB_HWCACHE_ALIGN);
if (nfs_cdata_cachep == NULL)
goto out_destroy_write_mempool;
--
2.39.2
next reply other threads:[~2024-02-29 9:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-29 9:41 kunwu.chan [this message]
2024-02-29 13:40 ` [PATCH] nfs: use KMEM_CACHE() to create nfs_commit_data cache Trond Myklebust
2024-03-01 2:06 ` Kunwu Chan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240229094112.1154644-1-kunwu.chan@linux.dev \
--to=kunwu.chan@linux.dev \
--cc=anna@kernel.org \
--cc=chentao@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@hammerspace.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox