Skip to content

Commit

Permalink
libublk: ctrl: improve document & comment
Browse files Browse the repository at this point in the history
Signed-off-by: Ming Lei <[email protected]>
  • Loading branch information
ming1 committed Feb 29, 2024
1 parent c6799d5 commit 6099e1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/ctrl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ const CTRL_PATH: &str = "/dev/ublk-control";

const MAX_BUF_SZ: u32 = 32_u32 << 20;

// per-thread control uring
//
std::thread_local! {
pub(crate) static CTRL_URING: RefCell<IoUring::<squeue::Entry128>> =
RefCell::new(IoUring::<squeue::Entry128>::builder()
Expand Down Expand Up @@ -1408,13 +1410,14 @@ impl UblkCtrl {
}

/// Run ublk daemon and kick off the ublk device, and `/dev/ublkbN` will be
/// created and visible to userspace.
/// created and exposed to userspace.
///
/// # Arguments:
///
/// * `tgt_fn`: target initialization handler
/// * `q_fn`: queue handler for setting up the queue and its handler
/// * `device_fn`: handler called after device is started, run in current
/// * `q_fn`: queue handler for setting up the queue and its handler,
/// all IO logical is implemented in queue handler
/// * `device_fn`: called after device is started, run in current
/// context
///
/// This one is the preferred interface for creating ublk daemon, and
Expand Down
5 changes: 1 addition & 4 deletions src/uring_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ fn ublk_process_queue_io(
nr_waits: usize,
) -> Result<i32, UblkError> {
let res = q.flush_and_wake_io_tasks(|data, cqe, _| ublk_wake_task(data, cqe), nr_waits);

if res.is_ok() {
while exe.try_tick() {}
}
while exe.try_tick() {}

res
}
Expand Down

0 comments on commit 6099e1e

Please sign in to comment.