]> 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)
commita9bfc545f6c876b7102b2a62442f1a698893e9b4
tree606736878ba8922977703f743bd22c5eb3f3d97b
parent6cf3980b84e765f8aa324aab862e8f2ce412c339
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