summaryrefslogtreecommitdiffstats
path: root/io_uring/net.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-03-06 18:57:33 +0100
committerJens Axboe <axboe@kernel.dk>2024-03-08 15:56:31 +0100
commitfb6328bc2ab58dcf2998bd173f1ef0f3eb7be19a (patch)
tree6c48a69b65feecc8f7d99f76417540764f277454 /io_uring/net.c
parentio_uring/kbuf: rename REQ_F_PARTIAL_IO to REQ_F_BL_NO_RECYCLE (diff)
downloadlinux-fb6328bc2ab58dcf2998bd173f1ef0f3eb7be19a.tar.xz
linux-fb6328bc2ab58dcf2998bd173f1ef0f3eb7be19a.zip
io_uring/net: simplify msghd->msg_inq checking
Just check for larger than zero rather than check for non-zero and not -1. This is easier to read, and also protects against any errants < 0 values that aren't -1. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r--io_uring/net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io_uring/net.c b/io_uring/net.c
index b97d70f905a8..1928629d490b 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -697,7 +697,7 @@ static inline bool io_recv_finish(struct io_kiocb *req, int *ret,
unsigned int cflags;
cflags = io_put_kbuf(req, issue_flags);
- if (msg->msg_inq && msg->msg_inq != -1)
+ if (msg->msg_inq > 0)
cflags |= IORING_CQE_F_SOCK_NONEMPTY;
if (!(req->flags & REQ_F_APOLL_MULTISHOT)) {
@@ -720,7 +720,7 @@ static inline bool io_recv_finish(struct io_kiocb *req, int *ret,
io_recv_prep_retry(req);
/* Known not-empty or unknown state, retry */
- if (cflags & IORING_CQE_F_SOCK_NONEMPTY || msg->msg_inq == -1) {
+ if (cflags & IORING_CQE_F_SOCK_NONEMPTY || msg->msg_inq < 0) {
if (sr->nr_multishot_loops++ < MULTISHOT_MAX_RETRY)
return false;
/* mshot retries exceeded, force a requeue */