projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b6ec4c
)
buffer: Use KMEM_CACHE instead of kmem_cache_create()
author
Kunwu Chan
<chentao@kylinos.cn>
Tue, 16 Jan 2024 09:11:37 +0000
(17:11 +0800)
committer
Christian Brauner
<brauner@kernel.org>
Mon, 22 Jan 2024 14:33:36 +0000
(15:33 +0100)
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>
Link:
https://lore.kernel.org/r/20240116091137.92375-1-chentao@kylinos.cn
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/buffer.c
patch
|
blob
|
history
diff --git
a/fs/buffer.c
b/fs/buffer.c
index dcafee512089a290d00993a023350b09bcfebb2f..b55dea034a5d8336994989266c36cf1ec7883cd0 100644
(file)
--- 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
*/