aboutsummaryrefslogtreecommitdiffstats
path: root/io_uring
diff options
context:
space:
mode:
authorKunwu Chan <chentao@kylinos.cn>2024-01-30 18:02:47 +0800
committerJens Axboe <axboe@kernel.dk>2024-02-08 13:27:06 -0700
commita6e959bd3d6bfe8a3daeeacb714a299b9094a6cb (patch)
tree916dcf2639e6a282920817c3f837df7c6890bc0f /io_uring
parentda08d2edb020026beac01d087d3b37e479fdb7e9 (diff)
downloadlinux-a6e959bd3d6bfe8a3daeeacb714a299b9094a6cb.tar.gz
io_uring: Simplify the allocation of slab caches
commit 0a31bd5f2bbb ("KMEM_CACHE(): simplify slab cache creation") introduces a new macro. 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/20240130100247.81460-1-chentao@kylinos.cn Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/io_uring.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index f1e3646c727c1e..72b9c1c1a24411 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -4176,9 +4176,8 @@ static int __init io_uring_init(void)
SLAB_ACCOUNT | SLAB_TYPESAFE_BY_RCU,
offsetof(struct io_kiocb, cmd.data),
sizeof_field(struct io_kiocb, cmd.data), NULL);
- io_buf_cachep = kmem_cache_create("io_buffer", sizeof(struct io_buffer), 0,
- SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT,
- NULL);
+ io_buf_cachep = KMEM_CACHE(io_buffer,
+ SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT);
#ifdef CONFIG_SYSCTL
register_sysctl_init("kernel", kernel_io_uring_disabled_table);