diff --git a/examples/loop.rs b/examples/loop.rs index ec7212c..32a9d33 100644 --- a/examples/loop.rs +++ b/examples/loop.rs @@ -195,8 +195,8 @@ fn lo_handle_io_cmd_sync(q: &UblkQueue<'_>, tag: u16, i: &UblkIOCtx, buf_addr: * // either start to handle or retry let off = (iod.start_sector << 9) as u64; let bytes = (iod.nr_sectors << 9) as u32; - let sqe = __lo_make_io_sqe(op, off, bytes, buf_addr); - q.ublk_submit_sqe_sync(sqe, data).unwrap(); + let sqe = __lo_make_io_sqe(op, off, bytes, buf_addr).user_data(data); + q.ublk_submit_sqe_sync(sqe).unwrap(); } } diff --git a/src/io.rs b/src/io.rs index c849d6c..18a448a 100644 --- a/src/io.rs +++ b/src/io.rs @@ -796,13 +796,7 @@ impl UblkQueue<'_> { } #[inline] - pub fn ublk_submit_sqe_sync( - &self, - sqe: io_uring::squeue::Entry, - user_data: u64, - ) -> Result<(), UblkError> { - let sqe = sqe.user_data(user_data); - + pub fn ublk_submit_sqe_sync(&self, sqe: io_uring::squeue::Entry) -> Result<(), UblkError> { loop { let res = unsafe { self.q_ring.borrow_mut().submission().push(&sqe) };