Skip to content

Commit 575e7b0

Browse files
isilenceaxboe
authored andcommitted
io_uring: rename the data cmd cache
Pick a more descriptive name for the cmd async data cache. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/20250319061251.21452-2-sidong.yang@furiosa.ai Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 146acfd commit 575e7b0

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

include/linux/io_uring_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ struct io_ring_ctx {
318318
struct io_alloc_cache apoll_cache;
319319
struct io_alloc_cache netmsg_cache;
320320
struct io_alloc_cache rw_cache;
321-
struct io_alloc_cache uring_cache;
321+
struct io_alloc_cache cmd_cache;
322322

323323
/*
324324
* Any cancelable uring_cmd is added to this list in

io_uring/io_uring.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static void io_free_alloc_caches(struct io_ring_ctx *ctx)
289289
io_alloc_cache_free(&ctx->apoll_cache, kfree);
290290
io_alloc_cache_free(&ctx->netmsg_cache, io_netmsg_cache_free);
291291
io_alloc_cache_free(&ctx->rw_cache, io_rw_cache_free);
292-
io_alloc_cache_free(&ctx->uring_cache, kfree);
292+
io_alloc_cache_free(&ctx->cmd_cache, kfree);
293293
io_alloc_cache_free(&ctx->msg_cache, kfree);
294294
io_futex_cache_free(ctx);
295295
io_rsrc_cache_free(ctx);
@@ -334,7 +334,7 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
334334
ret |= io_alloc_cache_init(&ctx->rw_cache, IO_ALLOC_CACHE_MAX,
335335
sizeof(struct io_async_rw),
336336
offsetof(struct io_async_rw, clear));
337-
ret |= io_alloc_cache_init(&ctx->uring_cache, IO_ALLOC_CACHE_MAX,
337+
ret |= io_alloc_cache_init(&ctx->cmd_cache, IO_ALLOC_CACHE_MAX,
338338
sizeof(struct io_uring_cmd_data), 0);
339339
spin_lock_init(&ctx->msg_lock);
340340
ret |= io_alloc_cache_init(&ctx->msg_cache, IO_ALLOC_CACHE_MAX,

io_uring/uring_cmd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static void io_req_uring_cleanup(struct io_kiocb *req, unsigned int issue_flags)
2828

2929
if (issue_flags & IO_URING_F_UNLOCKED)
3030
return;
31-
if (io_alloc_cache_put(&req->ctx->uring_cache, cache)) {
31+
if (io_alloc_cache_put(&req->ctx->cmd_cache, cache)) {
3232
ioucmd->sqe = NULL;
3333
req->async_data = NULL;
3434
req->flags &= ~REQ_F_ASYNC_DATA;
@@ -171,7 +171,7 @@ static int io_uring_cmd_prep_setup(struct io_kiocb *req,
171171
struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);
172172
struct io_uring_cmd_data *cache;
173173

174-
cache = io_uring_alloc_async_data(&req->ctx->uring_cache, req);
174+
cache = io_uring_alloc_async_data(&req->ctx->cmd_cache, req);
175175
if (!cache)
176176
return -ENOMEM;
177177
cache->op_data = NULL;

0 commit comments

Comments
 (0)