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>
pull/1188/head
Pavel Begunkov 2025-03-19 06:12:47 +00:00 committed by Jens Axboe
parent 146acfd0f6
commit 575e7b0629
3 changed files with 5 additions and 5 deletions

View File

@ -318,7 +318,7 @@ struct io_ring_ctx {
struct io_alloc_cache apoll_cache; struct io_alloc_cache apoll_cache;
struct io_alloc_cache netmsg_cache; struct io_alloc_cache netmsg_cache;
struct io_alloc_cache rw_cache; struct io_alloc_cache rw_cache;
struct io_alloc_cache uring_cache; struct io_alloc_cache cmd_cache;
/* /*
* Any cancelable uring_cmd is added to this list in * Any cancelable uring_cmd is added to this list in

View File

@ -289,7 +289,7 @@ static void io_free_alloc_caches(struct io_ring_ctx *ctx)
io_alloc_cache_free(&ctx->apoll_cache, kfree); io_alloc_cache_free(&ctx->apoll_cache, kfree);
io_alloc_cache_free(&ctx->netmsg_cache, io_netmsg_cache_free); io_alloc_cache_free(&ctx->netmsg_cache, io_netmsg_cache_free);
io_alloc_cache_free(&ctx->rw_cache, io_rw_cache_free); io_alloc_cache_free(&ctx->rw_cache, io_rw_cache_free);
io_alloc_cache_free(&ctx->uring_cache, kfree); io_alloc_cache_free(&ctx->cmd_cache, kfree);
io_alloc_cache_free(&ctx->msg_cache, kfree); io_alloc_cache_free(&ctx->msg_cache, kfree);
io_futex_cache_free(ctx); io_futex_cache_free(ctx);
io_rsrc_cache_free(ctx); io_rsrc_cache_free(ctx);
@ -334,7 +334,7 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
ret |= io_alloc_cache_init(&ctx->rw_cache, IO_ALLOC_CACHE_MAX, ret |= io_alloc_cache_init(&ctx->rw_cache, IO_ALLOC_CACHE_MAX,
sizeof(struct io_async_rw), sizeof(struct io_async_rw),
offsetof(struct io_async_rw, clear)); offsetof(struct io_async_rw, clear));
ret |= io_alloc_cache_init(&ctx->uring_cache, IO_ALLOC_CACHE_MAX, ret |= io_alloc_cache_init(&ctx->cmd_cache, IO_ALLOC_CACHE_MAX,
sizeof(struct io_uring_cmd_data), 0); sizeof(struct io_uring_cmd_data), 0);
spin_lock_init(&ctx->msg_lock); spin_lock_init(&ctx->msg_lock);
ret |= io_alloc_cache_init(&ctx->msg_cache, IO_ALLOC_CACHE_MAX, ret |= io_alloc_cache_init(&ctx->msg_cache, IO_ALLOC_CACHE_MAX,

View File

@ -28,7 +28,7 @@ static void io_req_uring_cleanup(struct io_kiocb *req, unsigned int issue_flags)
if (issue_flags & IO_URING_F_UNLOCKED) if (issue_flags & IO_URING_F_UNLOCKED)
return; return;
if (io_alloc_cache_put(&req->ctx->uring_cache, cache)) { if (io_alloc_cache_put(&req->ctx->cmd_cache, cache)) {
ioucmd->sqe = NULL; ioucmd->sqe = NULL;
req->async_data = NULL; req->async_data = NULL;
req->flags &= ~REQ_F_ASYNC_DATA; req->flags &= ~REQ_F_ASYNC_DATA;
@ -171,7 +171,7 @@ static int io_uring_cmd_prep_setup(struct io_kiocb *req,
struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd); struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd);
struct io_uring_cmd_data *cache; struct io_uring_cmd_data *cache;
cache = io_uring_alloc_async_data(&req->ctx->uring_cache, req); cache = io_uring_alloc_async_data(&req->ctx->cmd_cache, req);
if (!cache) if (!cache)
return -ENOMEM; return -ENOMEM;
cache->op_data = NULL; cache->op_data = NULL;