File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1208,6 +1208,27 @@ pub fn register_files_sparse(self: *IoUring, nr_files: u32) !void {
1208
1208
return handle_registration_result (res );
1209
1209
}
1210
1210
1211
+ // Registers range for fixed file allocations.
1212
+ // Available since 6.0
1213
+ pub fn register_file_alloc_range (self : * IoUring , offset : u32 , len : u32 ) ! void {
1214
+ assert (self .fd >= 0 );
1215
+
1216
+ const range = & linux.io_uring_file_index_range {
1217
+ .off = offset ,
1218
+ .len = len ,
1219
+ .resv = 0 ,
1220
+ };
1221
+
1222
+ const res = linux .io_uring_register (
1223
+ self .fd ,
1224
+ .REGISTER_FILE_ALLOC_RANGE ,
1225
+ @ptrCast (range ),
1226
+ @as (u32 , @sizeOf (linux .io_uring_file_index_range )),
1227
+ );
1228
+
1229
+ return handle_registration_result (res );
1230
+ }
1231
+
1211
1232
/// Registers the file descriptor for an eventfd that will be notified of completion events on
1212
1233
/// an io_uring instance.
1213
1234
/// Only a single a eventfd can be registered at any given point in time.
You can’t perform that action at this time.
0 commit comments