Commit 6bf8ad25 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe

io_uring/net: io_async_msghdr caches for sendzc

We already keep io_async_msghdr caches for normal send/recv requests,
use them also for zerocopy send.
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/42fa615b6e0be25f47a685c35d7b5e4f1b03d348.1662639236.git.asml.silence@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 858c293e
...@@ -196,10 +196,9 @@ int io_sendzc_prep_async(struct io_kiocb *req) ...@@ -196,10 +196,9 @@ int io_sendzc_prep_async(struct io_kiocb *req)
if (!zc->addr || req_has_async_data(req)) if (!zc->addr || req_has_async_data(req))
return 0; return 0;
if (io_alloc_async_data(req)) io = io_msg_alloc_async_prep(req);
if (!io)
return -ENOMEM; return -ENOMEM;
io = req->async_data;
ret = move_addr_to_kernel(zc->addr, zc->addr_len, &io->addr); ret = move_addr_to_kernel(zc->addr, zc->addr_len, &io->addr);
return ret; return ret;
} }
...@@ -212,9 +211,9 @@ static int io_setup_async_addr(struct io_kiocb *req, ...@@ -212,9 +211,9 @@ static int io_setup_async_addr(struct io_kiocb *req,
if (!addr || req_has_async_data(req)) if (!addr || req_has_async_data(req))
return -EAGAIN; return -EAGAIN;
if (io_alloc_async_data(req)) io = io_msg_alloc_async(req, issue_flags);
if (!io)
return -ENOMEM; return -ENOMEM;
io = req->async_data;
memcpy(&io->addr, addr, sizeof(io->addr)); memcpy(&io->addr, addr, sizeof(io->addr));
return -EAGAIN; return -EAGAIN;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment