diff options
author | Kunwu Chan <chentao@kylinos.cn> | 2024-01-16 17:11:37 +0800 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-01-22 15:33:36 +0100 |
commit | de8a3207aed33283a560193095b156d3b73fc4f0 (patch) | |
tree | 7ce27dc1f89662333f0f89e7263f69c3277a2a76 /fs/buffer.c | |
parent | 6b6ec4ca4e33d797f887cb2d7ecf365b652b338c (diff) | |
download | linux-de8a3207aed33283a560193095b156d3b73fc4f0.tar.gz linux-de8a3207aed33283a560193095b156d3b73fc4f0.tar.bz2 linux-de8a3207aed33283a560193095b156d3b73fc4f0.zip |
buffer: Use KMEM_CACHE instead of kmem_cache_create()
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>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index dcafee512089..b55dea034a5d 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 */ |