Skip to content

Commit

Permalink
libublk: io: don't pass user_data to ublk_submit_sqe_sync()
Browse files Browse the repository at this point in the history
For ublk_submit_sqe_sync(), the data is built from its caller, so
no need to pass it in.

Signed-off-by: Ming Lei <[email protected]>
  • Loading branch information
ming1 committed Mar 2, 2024
1 parent 202d278 commit bfa8270
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
8 changes: 1 addition & 7 deletions src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) };

Expand Down

0 comments on commit bfa8270

Please sign in to comment.