4
4
#![ warn( missing_docs) ]
5
5
6
6
#[ allow( clippy:: undocumented_unsafe_blocks) ]
7
- mod bindings ;
7
+ mod gen ;
8
8
pub mod operation;
9
9
mod probe;
10
10
mod queue;
@@ -16,7 +16,7 @@ use std::fs::File;
16
16
use std:: io:: Error as IOError ;
17
17
use std:: os:: unix:: io:: { AsRawFd , FromRawFd , RawFd } ;
18
18
19
- use bindings :: io_uring_params;
19
+ use gen :: io_uring_params;
20
20
use operation:: { Cqe , FixedFd , OpCode , Operation } ;
21
21
use probe:: { ProbeWrapper , PROBE_LEN } ;
22
22
pub use queue:: completion:: CQueueError ;
@@ -112,7 +112,7 @@ impl<T: Debug> IoUring<T> {
112
112
) -> Result < Self , IoUringError > {
113
113
let mut params = io_uring_params {
114
114
// Create the ring as disabled, so that we may register restrictions.
115
- flags : bindings :: IORING_SETUP_R_DISABLED ,
115
+ flags : gen :: IORING_SETUP_R_DISABLED ,
116
116
117
117
..Default :: default ( )
118
118
} ;
@@ -252,7 +252,7 @@ impl<T: Debug> IoUring<T> {
252
252
libc:: syscall (
253
253
libc:: SYS_io_uring_register ,
254
254
self . fd . as_raw_fd ( ) ,
255
- bindings :: IORING_REGISTER_ENABLE_RINGS ,
255
+ gen :: IORING_REGISTER_ENABLE_RINGS ,
256
256
std:: ptr:: null :: < libc:: c_void > ( ) ,
257
257
0 ,
258
258
)
@@ -277,7 +277,7 @@ impl<T: Debug> IoUring<T> {
277
277
libc:: syscall (
278
278
libc:: SYS_io_uring_register ,
279
279
self . fd . as_raw_fd ( ) ,
280
- bindings :: IORING_REGISTER_FILES ,
280
+ gen :: IORING_REGISTER_FILES ,
281
281
files
282
282
. iter ( )
283
283
. map ( |f| f. as_raw_fd ( ) )
@@ -301,7 +301,7 @@ impl<T: Debug> IoUring<T> {
301
301
libc:: syscall (
302
302
libc:: SYS_io_uring_register ,
303
303
self . fd . as_raw_fd ( ) ,
304
- bindings :: IORING_REGISTER_EVENTFD ,
304
+ gen :: IORING_REGISTER_EVENTFD ,
305
305
( & fd) as * const _ ,
306
306
1 ,
307
307
)
@@ -320,10 +320,10 @@ impl<T: Debug> IoUring<T> {
320
320
libc:: syscall (
321
321
libc:: SYS_io_uring_register ,
322
322
self . fd . as_raw_fd ( ) ,
323
- bindings :: IORING_REGISTER_RESTRICTIONS ,
323
+ gen :: IORING_REGISTER_RESTRICTIONS ,
324
324
restrictions
325
325
. iter ( )
326
- . map ( bindings :: io_uring_restriction:: from)
326
+ . map ( gen :: io_uring_restriction:: from)
327
327
. collect :: < Vec < _ > > ( )
328
328
. as_mut_slice ( )
329
329
. as_mut_ptr ( ) ,
@@ -341,7 +341,7 @@ impl<T: Debug> IoUring<T> {
341
341
// An alternative fix would be to keep an internal counter that tracks the number of
342
342
// submitted entries that haven't been completed and makes sure it doesn't exceed
343
343
// (2 * num_entries).
344
- if ( params. features & bindings :: IORING_FEAT_NODROP ) == 0 {
344
+ if ( params. features & gen :: IORING_FEAT_NODROP ) == 0 {
345
345
return Err ( IoUringError :: UnsupportedFeature ( "IORING_FEAT_NODROP" ) ) ;
346
346
}
347
347
@@ -356,7 +356,7 @@ impl<T: Debug> IoUring<T> {
356
356
libc:: syscall (
357
357
libc:: SYS_io_uring_register ,
358
358
self . fd . as_raw_fd ( ) ,
359
- bindings :: IORING_REGISTER_PROBE ,
359
+ gen :: IORING_REGISTER_PROBE ,
360
360
probes. as_mut_fam_struct_ptr ( ) ,
361
361
PROBE_LEN ,
362
362
)
@@ -367,7 +367,7 @@ impl<T: Debug> IoUring<T> {
367
367
let supported_opcodes: HashSet < u8 > = probes
368
368
. as_slice ( )
369
369
. iter ( )
370
- . filter ( |op| ( ( u32:: from ( op. flags ) ) & bindings :: IO_URING_OP_SUPPORTED ) != 0 )
370
+ . filter ( |op| ( ( u32:: from ( op. flags ) ) & gen :: IO_URING_OP_SUPPORTED ) != 0 )
371
371
. map ( |op| op. op )
372
372
. collect ( ) ;
373
373
0 commit comments