From: Kunwu Chan <chentao@kylinos.cn>
To: viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Kunwu Chan <chentao@kylinos.cn>
Subject: [PATCH] buffer: Use KMEM_CACHE instead of kmem_cache_create()
Date: Tue, 16 Jan 2024 17:11:37 +0800 [thread overview]
Message-ID: <20240116091137.92375-1-chentao@kylinos.cn> (raw)
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/buffer.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/fs/buffer.c b/fs/buffer.c
index d3bcf601d3e5..9c8156cce9b7 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -3121,12 +3121,8 @@ void __init buffer_init(void)
unsigned long nrpages;
int ret;
- bh_cachep = kmem_cache_create("buffer_head",
- sizeof(struct buffer_head), 0,
- (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
- SLAB_MEM_SPREAD),
- NULL);
-
+ bh_cachep = KMEM_CACHE(buffer_head,
+ SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|SLAB_MEM_SPREAD);
/*
* Limit the bh occupancy to 10% of ZONE_NORMAL
*/
--
2.39.2
next reply other threads:[~2024-01-16 9:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-16 9:11 Kunwu Chan [this message]
2024-01-16 10:38 ` [PATCH] buffer: Use KMEM_CACHE instead of kmem_cache_create() Jan Kara
2024-01-16 11:01 ` Christian Brauner
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=20240116091137.92375-1-chentao@kylinos.cn \
--to=chentao@kylinos.cn \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).