summaryrefslogtreecommitdiffstats
path: root/io_uring/net.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-07-02 09:16:46 -0600
committerJens Axboe <axboe@kernel.dk>2024-07-02 09:42:25 -0600
commit93d8032f4143c8d2ac3e10c6504385c26acc511f (patch)
tree445eea89a87f6be062762975eaaadd79eea9c0ba /io_uring/net.c
parent3b7c16be30e35ec035b2efcc0f7d7b368789c443 (diff)
downloadlinux-stable-93d8032f4143c8d2ac3e10c6504385c26acc511f.tar.gz
linux-stable-93d8032f4143c8d2ac3e10c6504385c26acc511f.tar.bz2
linux-stable-93d8032f4143c8d2ac3e10c6504385c26acc511f.zip
io_uring/net: cleanup io_recv_finish() bundle handling
Combine the two cases that check for whether or not this is a bundle, rather than having them as separate checks. This is easier to reduce, and it reduces the text associated with it as well. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/net.c')
-rw-r--r--io_uring/net.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/io_uring/net.c b/io_uring/net.c
index db4a4a03ce3a..25223e11958f 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -827,20 +827,20 @@ static inline bool io_recv_finish(struct io_kiocb *req, int *ret,
bool mshot_finished, unsigned issue_flags)
{
struct io_sr_msg *sr = io_kiocb_to_cmd(req, struct io_sr_msg);
- unsigned int cflags;
-
- if (sr->flags & IORING_RECVSEND_BUNDLE)
- cflags = io_put_kbufs(req, io_bundle_nbufs(kmsg, *ret),
- issue_flags);
- else
- cflags = io_put_kbuf(req, issue_flags);
+ unsigned int cflags = 0;
if (kmsg->msg.msg_inq > 0)
cflags |= IORING_CQE_F_SOCK_NONEMPTY;
- /* bundle with no more immediate buffers, we're done */
- if (sr->flags & IORING_RECVSEND_BUNDLE && req->flags & REQ_F_BL_EMPTY)
- goto finish;
+ if (sr->flags & IORING_RECVSEND_BUNDLE) {
+ cflags |= io_put_kbufs(req, io_bundle_nbufs(kmsg, *ret),
+ issue_flags);
+ /* bundle with no more immediate buffers, we're done */
+ if (req->flags & REQ_F_BL_EMPTY)
+ goto finish;
+ } else {
+ cflags |= io_put_kbuf(req, issue_flags);
+ }
/*
* Fill CQE for this receive and see if we should keep trying to