From ac3c53cebbba56640093c3c17e1e55ee2256f598 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 24 Apr 2026 17:31:03 +0200 Subject: [PATCH] block: raw: Rename RawFileAsync to RawAsync Apply the consistent naming convention. No functional change. Signed-off-by: Anatol Belski --- block/src/fixed_vhd_async.rs | 6 +++--- block/src/raw_async.rs | 8 ++++---- block/src/raw_disk.rs | 7 ++----- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/block/src/fixed_vhd_async.rs b/block/src/fixed_vhd_async.rs index 38a3d2c79..f5dc465e6 100644 --- a/block/src/fixed_vhd_async.rs +++ b/block/src/fixed_vhd_async.rs @@ -10,16 +10,16 @@ use vmm_sys_util::eventfd::EventFd; use crate::async_io::{AsyncIo, AsyncIoCompletion, AsyncIoError, AsyncIoOperation, AsyncIoResult}; use crate::error::BlockResult; -use crate::raw_async::RawFileAsync; +use crate::raw_async::RawAsync; pub struct FixedVhdAsync { - raw_file_async: RawFileAsync, + raw_file_async: RawAsync, size: u64, } impl FixedVhdAsync { pub fn new(fd: RawFd, ring_depth: u32, size: u64) -> BlockResult { - let raw_file_async = RawFileAsync::new(fd, ring_depth)?; + let raw_file_async = RawAsync::new(fd, ring_depth)?; Ok(FixedVhdAsync { raw_file_async, diff --git a/block/src/raw_async.rs b/block/src/raw_async.rs index b19f576fb..3acfac9cd 100644 --- a/block/src/raw_async.rs +++ b/block/src/raw_async.rs @@ -16,20 +16,20 @@ use crate::error::{BlockError, BlockErrorKind, BlockResult}; use crate::sparse::{blkdiscard, blkzeroout}; use crate::{SECTOR_SIZE, is_block_device}; -pub struct RawFileAsync { +pub struct RawAsync { fd: RawFd, data_io: UringDataIo, alignment: u64, is_block_device: bool, } -impl RawFileAsync { +impl RawAsync { pub fn new(fd: RawFd, ring_depth: u32) -> BlockResult { let data_io = UringDataIo::new(ring_depth).map_err(|e| BlockError::new(BlockErrorKind::Io, e))?; let is_block_device = is_block_device(fd); - Ok(RawFileAsync { + Ok(RawAsync { fd, data_io, alignment: SECTOR_SIZE, @@ -38,7 +38,7 @@ impl RawFileAsync { } } -impl AsyncIo for RawFileAsync { +impl AsyncIo for RawAsync { fn notifier(&self) -> &EventFd { self.data_io.notifier() } diff --git a/block/src/raw_disk.rs b/block/src/raw_disk.rs index a51b715f3..4b5d294bc 100644 --- a/block/src/raw_disk.rs +++ b/block/src/raw_disk.rs @@ -12,7 +12,7 @@ use log::warn; use crate::async_io::{AsyncIo, BorrowedDiskFd, DiskFileError}; use crate::error::{BlockError, BlockErrorKind, BlockResult}; #[cfg(feature = "io_uring")] -use crate::raw_async::RawFileAsync; +use crate::raw_async::RawAsync; use crate::raw_async_aio::RawFileAsyncAio; use crate::raw_sync::RawSync; use crate::{DiskTopology, disk_file, probe_sparse_support, query_device_size}; @@ -131,10 +131,7 @@ impl disk_file::AsyncDiskFile for RawDisk { match self.backend { RawBackend::Sync => Ok(Box::new(RawSync::new(self.file.as_raw_fd()))), #[cfg(feature = "io_uring")] - RawBackend::IoUring => Ok(Box::new(RawFileAsync::new( - self.file.as_raw_fd(), - ring_depth, - )?)), + RawBackend::IoUring => Ok(Box::new(RawAsync::new(self.file.as_raw_fd(), ring_depth)?)), RawBackend::Aio => Ok(Box::new(RawFileAsyncAio::new( self.file.as_raw_fd(), ring_depth,