]> git.itanic.dy.fi Git - linux-stable/commit
io_uring/kbuf: add method for returning provided buffer ring head
authorJens Axboe <axboe@kernel.dk>
Thu, 21 Dec 2023 16:02:57 +0000 (09:02 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 Dec 2023 16:47:06 +0000 (09:47 -0700)
commitd293b1a89694fc4918d9a4330a71ba2458f9d581
treec901f0e6a81018d4eeb4d44dd8c73944bb6fb5ea
parent0a535eddbe0dc1de4386046ab849f08aeb2f8faf
io_uring/kbuf: add method for returning provided buffer ring head

The tail of the provided ring buffer is shared between the kernel and
the application, but the head is private to the kernel as the
application doesn't need to see it. However, this also prevents the
application from knowing how many buffers the kernel has consumed.
Usually this is fine, as the information is inherently racy in that
the kernel could be consuming buffers continually, but for cleanup
purposes it may be relevant to know how many buffers are still left
in the ring.

Add IORING_REGISTER_PBUF_STATUS which will return status for a given
provided buffer ring. Right now it just returns the head, but space
is reserved for more information later in, if needed.

Link: https://github.com/axboe/liburing/discussions/1020
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/uapi/linux/io_uring.h
io_uring/kbuf.c
io_uring/kbuf.h
io_uring/register.c