diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2022-06-17 09:48:00 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-07-24 18:39:14 -0600 |
commit | d245bca6375bccfd589a6a7d5007df28575bb626 (patch) | |
tree | ce0fbcda110609810940ebd21bdebeb2d942513f /io_uring/net.c | |
parent | f09c8643f0fad0e287b9f737955276000fd76a5d (diff) | |
download | lwn-d245bca6375bccfd589a6a7d5007df28575bb626.tar.gz lwn-d245bca6375bccfd589a6a7d5007df28575bb626.zip |
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/net.c')
-rw-r--r-- | io_uring/net.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/io_uring/net.c b/io_uring/net.c index fe1fe920b929..35d0183fe758 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -644,22 +644,12 @@ retry: io_req_set_res(req, ret, 0); return IOU_OK; } - if (ret >= 0) { - bool filled; - - spin_lock(&ctx->completion_lock); - filled = io_fill_cqe_aux(ctx, req->cqe.user_data, ret, - IORING_CQE_F_MORE); - io_commit_cqring(ctx); - spin_unlock(&ctx->completion_lock); - if (filled) { - io_cqring_ev_posted(ctx); - goto retry; - } - ret = -ECANCELED; - } - return ret; + if (ret < 0) + return ret; + if (io_post_aux_cqe(ctx, req->cqe.user_data, ret, IORING_CQE_F_MORE)) + goto retry; + return -ECANCELED; } int io_socket_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) |