[PATCH for-next 2/3] alloc range helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx>
---
 src/include/liburing.h |  3 +++
 src/register.c         | 14 ++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/src/include/liburing.h b/src/include/liburing.h
index bb2fb87..45b4da0 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -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.
diff --git a/src/register.c b/src/register.c
index f2b1026..ee370d6 100644
--- a/src/register.c
+++ b/src/register.c
@@ -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);
+}
-- 
2.36.1




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux