From: Jeff Layton <jlayton@kernel.org>
To: Kunwu Chan <chentao@kylinos.cn>,
chuck.lever@oracle.com, neilb@suse.de, kolga@netapp.com,
Dai.Ngo@oracle.com, tom@talpey.com
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nfsd: Simplify the allocation of slab caches in nfsd_file_cache_init
Date: Wed, 31 Jan 2024 06:08:36 -0500 [thread overview]
Message-ID: <859f66e1fa4de08662a3ff6ef399803516780fbb.camel@kernel.org> (raw)
In-Reply-To: <20240131065653.133965-1-chentao@kylinos.cn>
On Wed, 2024-01-31 at 14:56 +0800, Kunwu Chan wrote:
> 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/nfsd/filecache.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
> index 8d9f7b07e35b..f3a642fd0eca 100644
> --- a/fs/nfsd/filecache.c
> +++ b/fs/nfsd/filecache.c
> @@ -722,15 +722,13 @@ nfsd_file_cache_init(void)
> return ret;
>
> ret = -ENOMEM;
> - nfsd_file_slab = kmem_cache_create("nfsd_file",
> - sizeof(struct nfsd_file), 0, 0, NULL);
> + nfsd_file_slab = KMEM_CACHE(nfsd_file, 0);
> if (!nfsd_file_slab) {
> pr_err("nfsd: unable to create nfsd_file_slab\n");
> goto out_err;
> }
>
> - nfsd_file_mark_slab = kmem_cache_create("nfsd_file_mark",
> - sizeof(struct nfsd_file_mark), 0, 0, NULL);
> + nfsd_file_mark_slab = KMEM_CACHE(nfsd_file_mark, 0);
> if (!nfsd_file_mark_slab) {
> pr_err("nfsd: unable to create nfsd_file_mark_slab\n");
> goto out_err;
Sure, I guess:
Acked-by: Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2024-01-31 11:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 6:56 [PATCH] nfsd: Simplify the allocation of slab caches in nfsd_file_cache_init Kunwu Chan
2024-01-31 11:08 ` Jeff Layton [this message]
2024-01-31 15:33 ` Chuck Lever
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=859f66e1fa4de08662a3ff6ef399803516780fbb.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=chentao@kylinos.cn \
--cc=chuck.lever@oracle.com \
--cc=kolga@netapp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=tom@talpey.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