]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: refactor sendmsg/recvmsg iov managing
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 5 Feb 2021 00:58:00 +0000 (00:58 +0000)
committerJens Axboe <axboe@kernel.dk>
Fri, 5 Feb 2021 14:46:22 +0000 (07:46 -0700)
commit7f4d1e663bead197091a8c2147b2d525562a72c8
tree17fd1d47bbfbf004d92c8e51b89dc2222b61fc9b
parent32c61a514db8ea0c0f53b8f713ef1692b8671f61
io_uring: refactor sendmsg/recvmsg iov managing

Current iov handling with recvmsg/sendmsg may be confusing. First make a
rule for msg->iov: either it points to an allocated iov that have to be
kfree()'d later, or it's NULL and we use fast_iov. That's much better
than current 3-state (also can point to fast_iov). And rename it into
free_iov for uniformity with read/write.

Also, instead of after struct io_async_msghdr copy fixing up of
msg.msg_iter.iov has been happening in io_recvmsg()/io_sendmsg(). Move
it into io_setup_async_msg(), that's the right place.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
[axboe: add comment on NULL check before kfree()]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c