io-uring
io-uring copied to clipboard
feat: add support for ReadMulti opcode (6.7+)
Simple addition, already have the CODE in the /sys/
Right now I'm doing what feels like a crime against humanity by implementing like this and having tons of structures copy-pasta'd from the /sys/ part of the crate, would really appreciate if we can merge so I don't use this abomination :
pub struct ReadMulti {
fd: i32,
buf_group: u16,
flags: i32,
}
impl ReadMulti {
#[inline]
pub fn new(fd: i32, buf_group: u16) -> Self {
ReadMulti {
fd,
buf_group,
flags: 0,
}
}
#[inline]
pub fn build(self) -> Entry {
let sqe = CustomSQE {
opcode: IORING_OP_READ_MULTISHOT as _,
flags: io_uring::squeue::Flags::BUFFER_SELECT.bits(),
fd: self.fd,
buf_index: PackedU16 {
buf_index: self.buf_group,
},
msg_flags: Union3 {
msg_flags: self.flags as _,
},
..Default::default()
};
// Safety: CustomSQE has identical memory layout to io_uring_sqe
#[allow(unsafe_code)]
unsafe {
std::mem::transmute(sqe)
}
}
}
This looks good, would you like to add a test?
@quininer done also, not sure what your release-plans are, but would appreciate if it's possible to bump to 0.7.5 soon after