Commit 68a2cc1b authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe

io_uring: refactor __io_req_complete_post

Keep parts of __io_req_complete_post() relying on req->flags together so
the value can be cached.
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/2b4fbb42f404a0e75c4d9f0a5b16f314a839d0a9.1673887636.git.asml.silence@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 632ffe09
...@@ -974,14 +974,14 @@ static void __io_req_complete_post(struct io_kiocb *req) ...@@ -974,14 +974,14 @@ static void __io_req_complete_post(struct io_kiocb *req)
req->link = NULL; req->link = NULL;
} }
} }
io_put_kbuf_comp(req);
io_dismantle_req(req);
io_req_put_rsrc(req); io_req_put_rsrc(req);
/* /*
* Selected buffer deallocation in io_clean_op() assumes that * Selected buffer deallocation in io_clean_op() assumes that
* we don't hold ->completion_lock. Clean them here to avoid * we don't hold ->completion_lock. Clean them here to avoid
* deadlocks. * deadlocks.
*/ */
io_put_kbuf_comp(req);
io_dismantle_req(req);
io_put_task(req->task, 1); io_put_task(req->task, 1);
wq_list_add_head(&req->comp_list, &ctx->locked_free_list); wq_list_add_head(&req->comp_list, &ctx->locked_free_list);
ctx->locked_free_nr++; ctx->locked_free_nr++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment