summaryrefslogtreecommitdiff
path: root/io_uring/msg_ring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-06-17 11:48:00 +0300
committerJens Axboe <axboe@kernel.dk>2022-07-25 03:39:14 +0300
commitd245bca6375bccfd589a6a7d5007df28575bb626 (patch)
treece0fbcda110609810940ebd21bdebeb2d942513f /io_uring/msg_ring.c
parentf09c8643f0fad0e287b9f737955276000fd76a5d (diff)
downloadlinux-d245bca6375bccfd589a6a7d5007df28575bb626.tar.xz
io_uring: don't expose io_fill_cqe_aux()
Deduplicate some code and add a helper for filling an aux CQE, locking and notification. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/b7c6557c8f9dc5c4cfb01292116c682a0ff61081.1655455613.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/msg_ring.c')
-rw-r--r--io_uring/msg_ring.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/io_uring/msg_ring.c b/io_uring/msg_ring.c
index 3b89f9a0a0b4..7c3c5f3ab06b 100644
--- a/io_uring/msg_ring.c
+++ b/io_uring/msg_ring.c
@@ -34,7 +34,6 @@ int io_msg_ring(struct io_kiocb *req, unsigned int issue_flags)
{
struct io_msg *msg = io_kiocb_to_cmd(req);
struct io_ring_ctx *target_ctx;
- bool filled;
int ret;
ret = -EBADFD;
@@ -43,16 +42,8 @@ int io_msg_ring(struct io_kiocb *req, unsigned int issue_flags)
ret = -EOVERFLOW;
target_ctx = req->file->private_data;
-
- spin_lock(&target_ctx->completion_lock);
- filled = io_fill_cqe_aux(target_ctx, msg->user_data, msg->len, 0);
- io_commit_cqring(target_ctx);
- spin_unlock(&target_ctx->completion_lock);
-
- if (filled) {
- io_cqring_ev_posted(target_ctx);
+ if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0))
ret = 0;
- }
done:
if (ret < 0)