Skip to content

Commit

Permalink
block: Simplify the allocation of slab caches
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20240131094323.146659-1-chentao@kylinos.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Kunwu Chan authored and Jens Axboe committed Feb 8, 2024
1 parent e516c3f commit 48ff13a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1232,8 +1232,7 @@ int __init blk_dev_init(void)
if (!kblockd_workqueue)
panic("Failed to create kblockd\n");

blk_requestq_cachep = kmem_cache_create("request_queue",
sizeof(struct request_queue), 0, SLAB_PANIC, NULL);
blk_requestq_cachep = KMEM_CACHE(request_queue, SLAB_PANIC);

blk_debugfs_root = debugfs_create_dir("block", NULL);

Expand Down

0 comments on commit 48ff13a

Please sign in to comment.