Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add io_uring_sqe64,io_uring_sqe128,io_uring_cqe16,io_uring_cqe32 #998

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions src/io_uring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,8 @@ impl core::fmt::Debug for io_uring_user_data {
/// An io_uring Submission Queue Entry.
#[allow(missing_docs)]
#[repr(C)]
#[derive(Copy, Clone, Default)]
pub struct io_uring_sqe {
#[derive(Copy, Clone)]
pub struct io_uring_sqe<T: Copy> {
pub opcode: IoringOp,
pub flags: IoringSqeFlags,
pub ioprio: ioprio_union,
Expand All @@ -1029,9 +1029,15 @@ pub struct io_uring_sqe {
pub buf: buf_union,
pub personality: u16,
pub splice_fd_in_or_file_index: splice_fd_in_or_file_index_union,
pub addr3_or_cmd: addr3_or_cmd_union,
pub addr3_or_cmd: addr3_or_cmd_union<T>,
}

#[allow(missing_docs)]
pub type io_uring_sqe64 = io_uring_cqe<()>;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub type io_uring_sqe64 = io_uring_cqe<()>;
pub type io_uring_sqe64 = io_uring_sqe<()>;


#[allow(missing_docs)]
pub type io_uring_sqe128 = io_uring_cqe<[u8; 80]>;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub type io_uring_sqe128 = io_uring_cqe<[u8; 80]>;
pub type io_uring_sqe128 = io_uring_sqe<[u8; 80]>;


#[allow(missing_docs)]
#[repr(C)]
#[derive(Copy, Clone)]
Expand All @@ -1053,9 +1059,9 @@ pub union len_union {
#[allow(missing_docs)]
#[repr(C)]
#[derive(Copy, Clone)]
pub union addr3_or_cmd_union {
pub union addr3_or_cmd_union<T: Copy> {
pub addr3: addr3_struct,
pub cmd: [u8; 0],
pub cmd: T,
}

#[allow(missing_docs)]
Expand Down Expand Up @@ -1165,14 +1171,20 @@ pub struct io_uring_sync_cancel_reg {
/// automatically copyable.
#[allow(missing_docs)]
#[repr(C)]
#[derive(Debug, Default)]
pub struct io_uring_cqe {
#[derive(Clone, Copy)]
pub struct io_uring_cqe<T: Copy> {
pub user_data: io_uring_user_data,
pub res: i32,
pub flags: IoringCqeFlags,
pub big_cqe: sys::__IncompleteArrayField<u64>,
pub big_cqe: T,
}

#[allow(missing_docs)]
pub type io_uring_cqe16 = io_uring_cqe<()>;

#[allow(missing_docs)]
pub type io_uring_cqe32 = io_uring_cqe<[u64; 2]>;

#[allow(missing_docs)]
#[repr(C)]
#[derive(Copy, Clone, Default)]
Expand Down Expand Up @@ -1390,13 +1402,6 @@ impl Default for addr_or_splice_off_in_union {
}
}

impl Default for addr3_or_cmd_union {
#[inline]
fn default() -> Self {
default_union!(addr3_or_cmd_union, addr3)
}
}

impl Default for op_flags_union {
#[inline]
fn default() -> Self {
Expand Down
Loading