Skip to content

Commit 62aa980

Browse files
calebsanderaxboe
authored andcommitted
io_uring: use lockless_cq flag in io_req_complete_post()
io_uring_create() computes ctx->lockless_cq as: ctx->task_complete || (ctx->flags & IORING_SETUP_IOPOLL) So use it to simplify that expression in io_req_complete_post(). Signed-off-by: Caleb Sander Mateos <[email protected]> Reviewed-by: Li Zetao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 94a4274 commit 62aa980

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ static void io_req_complete_post(struct io_kiocb *req, unsigned issue_flags)
900900
* Handle special CQ sync cases via task_work. DEFER_TASKRUN requires
901901
* the submitter task context, IOPOLL protects with uring_lock.
902902
*/
903-
if (ctx->task_complete || (ctx->flags & IORING_SETUP_IOPOLL)) {
903+
if (ctx->lockless_cq) {
904904
req->io_task_work.func = io_req_task_complete;
905905
io_req_task_work_add(req);
906906
return;

0 commit comments

Comments
 (0)