From b203090bc2abeb24d25346e090e11d052cfa8565 Mon Sep 17 00:00:00 2001 From: Ming Lei Date: Fri, 6 Oct 2023 08:30:17 +0000 Subject: [PATCH] libublk: io: rename process_io as wait_ios 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 --- src/io.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/io.rs b/src/io.rs index f609534..08b893c 100644 --- a/src/io.rs +++ b/src/io.rs @@ -723,7 +723,7 @@ impl UblkQueue<'_> { } #[inline(always)] - fn process_io(&mut self, to_wait: usize) -> Result { + fn wait_ios(&mut self, to_wait: usize) -> Result { info!( "dev{}-q{}: to_submit {} inflight cmd {} stopping {}", self.dev.dev_info.dev_id, @@ -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) @@ -807,7 +803,11 @@ impl UblkQueue<'_> { where F: FnMut(&mut UblkIOCtx) -> Result, { - 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 {