diff options
| author | Pavel Begunkov <asml.silence@gmail.com> | 2025-03-08 17:19:33 +0000 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-03-10 07:14:18 -0600 |
| commit | 5027d02452c982bdc7b36205c66466ebd7e6ee17 (patch) | |
| tree | db67654ef73d3f1c6b214178ac03db989c97c82d /io_uring/net.c | |
| parent | 7a9dcb05f5501b07a2ef7d0ef743f4f17e9f3055 (diff) | |
| download | linux-5027d02452c982bdc7b36205c66466ebd7e6ee17.tar.gz linux-5027d02452c982bdc7b36205c66466ebd7e6ee17.tar.bz2 linux-5027d02452c982bdc7b36205c66466ebd7e6ee17.zip | |
io_uring: unify STOP_MULTISHOT with IOU_OK
IOU_OK means that the request ownership is now handed back to core
io_uring and it has to complete it using the result provided in
req->cqe. Same is true for multishot and IOU_STOP_MULTISHOT.
Rename it into IOU_COMPLETE to avoid confusion and use for both modes.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/e6a5b2edb0eb9558acb1c8f1db38ac45fee95491.1741453534.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 | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/io_uring/net.c b/io_uring/net.c index d9befb6fb8a7..9fa5c9570875 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -915,11 +915,7 @@ static inline bool io_recv_finish(struct io_kiocb *req, int *ret, /* Finish the request / stop multishot. */ finish: io_req_set_res(req, *ret, cflags); - - if (issue_flags & IO_URING_F_MULTISHOT) - *ret = IOU_STOP_MULTISHOT; - else - *ret = IOU_OK; + *ret = IOU_COMPLETE; io_req_msg_cleanup(req, issue_flags); return true; } @@ -1288,9 +1284,7 @@ int io_recvzc(struct io_kiocb *req, unsigned int issue_flags) if (len && zc->len == 0) { io_req_set_res(req, 0, 0); - if (issue_flags & IO_URING_F_MULTISHOT) - return IOU_STOP_MULTISHOT; - return IOU_OK; + return IOU_COMPLETE; } if (unlikely(ret <= 0) && ret != -EAGAIN) { if (ret == -ERESTARTSYS) @@ -1300,10 +1294,7 @@ int io_recvzc(struct io_kiocb *req, unsigned int issue_flags) req_set_fail(req); io_req_set_res(req, ret, 0); - - if (issue_flags & IO_URING_F_MULTISHOT) - return IOU_STOP_MULTISHOT; - return IOU_OK; + return IOU_COMPLETE; } return IOU_RETRY; } @@ -1709,9 +1700,7 @@ retry: io_req_set_res(req, ret, cflags); if (ret < 0) req_set_fail(req); - if (!(issue_flags & IO_URING_F_MULTISHOT)) - return IOU_OK; - return IOU_STOP_MULTISHOT; + return IOU_COMPLETE; } int io_socket_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) |
