]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: allow empty slots for reg buffers
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 28 Apr 2021 12:11:29 +0000 (13:11 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 29 Apr 2021 19:26:19 +0000 (13:26 -0600)
commitfbd080dec1375d6a3d8454d86fe488cdae279f42
tree606736878ba8922977703f743bd22c5eb3f3d97b
parentf081f16d17783e4bcf67d5802f6a3954ca5b3b79
io_uring: allow empty slots for reg buffers

Allow empty reg buffer slots any request using which should fail. This
allows users to not register all buffers in advance, but do it lazily
and/or on demand via updates. That is achieved by setting iov_base and
iov_len to zero for registration and/or buffer updates. Empty buffer
can't have a non-zero tag.

Implementation details: to not add extra overhead to io_import_fixed(),
create a dummy buffer crafted to fail any request using it, and set it
to all empty buffer slots.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/7e95e4d700082baaf010c648c72ac764c9cc8826.1619611868.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c