Skip to content

Commit 59b28a6

Browse files
committed
io_uring/msg_ring: cleanup posting to IOPOLL vs !IOPOLL ring
Move the posting outside the checking and locking, it's cleaner that way. Signed-off-by: Jens Axboe <[email protected]>
1 parent 79996b4 commit 59b28a6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

io_uring/msg_ring.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,11 @@ static int io_msg_ring_data(struct io_kiocb *req, unsigned int issue_flags)
147147
if (target_ctx->flags & IORING_SETUP_IOPOLL) {
148148
if (unlikely(io_double_lock_ctx(target_ctx, issue_flags)))
149149
return -EAGAIN;
150-
if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, flags))
151-
ret = 0;
152-
io_double_unlock_ctx(target_ctx);
153-
} else {
154-
if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, flags))
155-
ret = 0;
156150
}
151+
if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, flags))
152+
ret = 0;
153+
if (target_ctx->flags & IORING_SETUP_IOPOLL)
154+
io_double_unlock_ctx(target_ctx);
157155
return ret;
158156
}
159157

0 commit comments

Comments
 (0)