diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2025-03-31 17:18:00 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2025-04-21 05:06:58 -0600 |
commit | e6f74fd67d50c8a938fcfa83c97cd06995f6aaa1 (patch) | |
tree | a03f369cb38d1477979a5e35c4980d7b30b1c7ab | |
parent | e9ff9ae103573c7393d80533214a567654987ed5 (diff) |
io_uring: set IMPORT_BUFFER in generic send setup
Move REQ_F_IMPORT_BUFFER to the common send setup. Currently, the only
user is send zc, but we'll want for normal sends to support that in the
future.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/18b74edfc61d8a1b6c9fed3b78a9276fe80f8ced.1743437358.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | io_uring/net.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/io_uring/net.c b/io_uring/net.c index b9a03aeda4bb..eb2130112e0e 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -359,8 +359,10 @@ static int io_send_setup(struct io_kiocb *req, const struct io_uring_sqe *sqe) kmsg->msg.msg_name = &kmsg->addr; kmsg->msg.msg_namelen = addr_len; } - if (sr->flags & IORING_RECVSEND_FIXED_BUF) + if (sr->flags & IORING_RECVSEND_FIXED_BUF) { + req->flags |= REQ_F_IMPORT_BUFFER; return 0; + } if (req->flags & REQ_F_BUFFER_SELECT) return 0; return import_ubuf(ITER_SOURCE, sr->buf, sr->len, &kmsg->msg.msg_iter); @@ -1313,8 +1315,6 @@ int io_send_zc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) return -ENOMEM; if (req->opcode == IORING_OP_SEND_ZC) { - if (zc->flags & IORING_RECVSEND_FIXED_BUF) - req->flags |= REQ_F_IMPORT_BUFFER; ret = io_send_setup(req, sqe); } else { if (unlikely(sqe->addr2 || sqe->file_index)) |