Skip to content

Commit

Permalink
libublk: io: rename process_io as wait_ios
Browse files Browse the repository at this point in the history
process_io() actually just waits for incoming io commands and target IO
from io_uring, so it is readable to name it as wait_ios().

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
  • Loading branch information
ming1 committed Oct 6, 2023
1 parent 9965c86 commit b203090
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ impl UblkQueue<'_> {
}

#[inline(always)]
fn process_io(&mut self, to_wait: usize) -> Result<i32, UblkError> {
fn wait_ios(&mut self, to_wait: usize) -> Result<i32, UblkError> {
info!(
"dev{}-q{}: to_submit {} inflight cmd {} stopping {}",
self.dev.dev_info.dev_id,
Expand All @@ -733,10 +733,6 @@ impl UblkQueue<'_> {
(self.q_state & UBLK_QUEUE_STOPPING)
);

if self.queue_is_done() && self.q_ring.submission().is_empty() {
return Err(UblkError::QueueIsDown(-libc::ENODEV));
}

let ret = self
.q_ring
.submit_and_wait(to_wait)
Expand Down Expand Up @@ -807,7 +803,11 @@ impl UblkQueue<'_> {
where
F: FnMut(&mut UblkIOCtx) -> Result<UblkIORes, UblkError>,
{
match self.process_io(to_wait) {
if self.queue_is_done() && self.q_ring.submission().is_empty() {
return Err(UblkError::QueueIsDown(-libc::ENODEV));
}

match self.wait_ios(to_wait) {
Err(r) => Err(r),
Ok(done) => {
for idx in 0..done {
Expand Down

0 comments on commit b203090

Please sign in to comment.