| ... | @@ -15,11 +15,11 @@ pub const IO_Uring = struct { | ... | @@ -15,11 +15,11 @@ pub const IO_Uring = struct { |
| 15 | features: u32, | 15 | features: u32, |
| 16 | | 16 | |
| 17 | /// A friendly way to setup an io_uring, with default linux.io_uring_params. | 17 | /// A friendly way to setup an io_uring, with default linux.io_uring_params. |
| 18 | /// `entries` must be a power of two between 1 and 4096, although the kernel will make the final | 18 | /// `entries` must be a power of two between 1 and 32768, although the kernel will make the final |
| 19 | /// call on how many entries the submission and completion queues will ultimately have, | 19 | /// call on how many entries the submission and completion queues will ultimately have, |
| 20 | /// see https://github.com/torvalds/linux/blob/v5.8/fs/io_uring.c#L8027-L8050. | 20 | /// see https://github.com/torvalds/linux/blob/v5.8/fs/io_uring.c#L8027-L8050. |
| 21 | /// Matches the interface of io_uring_queue_init() in liburing. | 21 | /// Matches the interface of io_uring_queue_init() in liburing. |
| 22 | pub fn init(entries: u13, flags: u32) !IO_Uring { | 22 | pub fn init(entries: u16, flags: u32) !IO_Uring { |
| 23 | var params = mem.zeroInit(linux.io_uring_params, .{ | 23 | var params = mem.zeroInit(linux.io_uring_params, .{ |
| 24 | .flags = flags, | 24 | .flags = flags, |
| 25 | .sq_thread_idle = 1000, | 25 | .sq_thread_idle = 1000, |
| ... | @@ -31,7 +31,7 @@ pub const IO_Uring = struct { | ... | @@ -31,7 +31,7 @@ pub const IO_Uring = struct { |
| 31 | /// queue thread cpu affinity or thread idle timeout (the kernel and our default is 1 second). | 31 | /// queue thread cpu affinity or thread idle timeout (the kernel and our default is 1 second). |
| 32 | /// `params` is passed by reference because the kernel needs to modify the parameters. | 32 | /// `params` is passed by reference because the kernel needs to modify the parameters. |
| 33 | /// Matches the interface of io_uring_queue_init_params() in liburing. | 33 | /// Matches the interface of io_uring_queue_init_params() in liburing. |
| 34 | pub fn init_params(entries: u13, p: *linux.io_uring_params) !IO_Uring { | 34 | pub fn init_params(entries: u16, p: *linux.io_uring_params) !IO_Uring { |
| 35 | if (entries == 0) return error.EntriesZero; | 35 | if (entries == 0) return error.EntriesZero; |
| 36 | if (!std.math.isPowerOfTwo(entries)) return error.EntriesNotPowerOfTwo; | 36 | if (!std.math.isPowerOfTwo(entries)) return error.EntriesNotPowerOfTwo; |
| 37 | | 37 | |