summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-03-28 19:42:40 +0300
committerJens Axboe <axboe@kernel.dk>2024-05-02 02:13:51 +0300
commit59b28a6e37e650c0d601ed87875b6217140cda5d (patch)
tree68b2b5468e2fe364f9458836c0bc9c42cb21b7c3 /io_uring
parent79996b45f7b28c0e3e08a95bab80119e95317e28 (diff)
downloadlinux-59b28a6e37e650c0d601ed87875b6217140cda5d.tar.xz
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 <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/msg_ring.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/io_uring/msg_ring.c b/io_uring/msg_ring.c
index d74670b39ed6..81c4a9d43729 100644
--- a/io_uring/msg_ring.c
+++ b/io_uring/msg_ring.c
@@ -147,13 +147,11 @@ static int io_msg_ring_data(struct io_kiocb *req, unsigned int issue_flags)
if (target_ctx->flags & IORING_SETUP_IOPOLL) {
if (unlikely(io_double_lock_ctx(target_ctx, issue_flags)))
return -EAGAIN;
- if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, flags))
- ret = 0;
- io_double_unlock_ctx(target_ctx);
- } else {
- if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, flags))
- ret = 0;
}
+ if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, flags))
+ ret = 0;
+ if (target_ctx->flags & IORING_SETUP_IOPOLL)
+ io_double_unlock_ctx(target_ctx);
return ret;
}