@@ -186,6 +186,9 @@ int io_uring_unregister_buf_ring(struct io_uring *ring, int bgid);
int io_uring_register_sync_cancel(struct io_uring *ring,
struct io_uring_sync_cancel_reg *reg);
+int io_uring_register_file_alloc_range(struct io_uring *ring,
+ unsigned off, unsigned len);
+
/*
* Helper for the peek/wait single cqe functions. Exported because of that,
* but probably shouldn't be used directly in an application.
@@ -59,4 +59,5 @@ LIBURING_2.2 {
LIBURING_2.3 {
global:
io_uring_register_sync_cancel;
+ io_uring_register_file_alloc_range;
} LIBURING_2.2;
@@ -352,3 +352,17 @@ int io_uring_register_sync_cancel(struct io_uring *ring,
return ____sys_io_uring_register(ring->ring_fd,
IORING_REGISTER_SYNC_CANCEL, reg, 1);
}
+
+int io_uring_register_file_alloc_range(struct io_uring *ring,
+ unsigned off, unsigned len)
+{
+ struct io_uring_file_index_range range;
+
+ memset(&range, 0, sizeof(range));
+ range.off = off;
+ range.len = len;
+
+ return ____sys_io_uring_register(ring->ring_fd,
+ IORING_REGISTER_FILE_ALLOC_RANGE,
+ &range, 0);
+}
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> --- src/include/liburing.h | 3 +++ src/liburing.map | 1 + src/register.c | 14 ++++++++++++++ 3 files changed, 18 insertions(+)