diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-02-12 04:23:50 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-02-12 13:30:25 +0100 |
commit | bd75904590de1c2bbdff55180cef209b13bd50fa (patch) | |
tree | e3975157a45022f98d3a5a30f97d728fa6853ea1 /fs | |
parent | io_uring: inline io_complete_rw_common() (diff) | |
download | linux-bd75904590de1c2bbdff55180cef209b13bd50fa.tar.xz linux-bd75904590de1c2bbdff55180cef209b13bd50fa.zip |
io_uring: take compl state from submit state
Completion and submission states are now coupled together, it's weird to
get one from argument and another from ctx, do it consistently for
io_req_free_batch(). It's also faster as we already have @state cached
in registers.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/io_uring.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 7b1979624320..8c2613bf54d3 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2417,13 +2417,10 @@ static void io_req_free_batch(struct req_batch *rb, struct io_kiocb *req, rb->ctx_refs++; io_dismantle_req(req); - if (state->free_reqs != ARRAY_SIZE(state->reqs)) { + if (state->free_reqs != ARRAY_SIZE(state->reqs)) state->reqs[state->free_reqs++] = req; - } else { - struct io_comp_state *cs = &req->ctx->submit_state.comp; - - list_add(&req->compl.list, &cs->free_list); - } + else + list_add(&req->compl.list, &state->comp.free_list); } static void io_submit_flush_completions(struct io_comp_state *cs, |