Skip to content

Commit 5ca6ff8

Browse files
weltlinglikebreath
authored andcommitted
block: vhd: Remove legacy async_io::DiskFile impl from FixedVhdDiskSync
No remaining consumers after switching to DiskBackend::Next. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>
1 parent c90f5a9 commit 5ca6ff8

1 file changed

Lines changed: 1 addition & 30 deletions

File tree

block/src/fixed_vhd_sync.rs

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ use std::os::unix::io::{AsRawFd, RawFd};
77

88
use vmm_sys_util::eventfd::EventFd;
99

10-
use crate::async_io::{
11-
AsyncIo, AsyncIoError, AsyncIoResult, BorrowedDiskFd, DiskFile, DiskFileError, DiskFileResult,
12-
};
10+
use crate::async_io::{AsyncIo, AsyncIoError, AsyncIoResult, BorrowedDiskFd, DiskFileError};
1311
use crate::error::{BlockError, BlockErrorKind, BlockResult, ErrorOp};
1412
use crate::fixed_vhd::FixedVhd;
1513
use crate::raw_sync::RawFileSync;
@@ -26,33 +24,6 @@ impl FixedVhdDiskSync {
2624
}
2725
}
2826

29-
impl DiskFile for FixedVhdDiskSync {
30-
fn logical_size(&mut self) -> DiskFileResult<u64> {
31-
Ok(self.0.logical_size().unwrap())
32-
}
33-
34-
fn physical_size(&mut self) -> DiskFileResult<u64> {
35-
self.0.physical_size().map_err(|e| {
36-
let io_inner = match e {
37-
crate::Error::GetFileMetadata(e) => e,
38-
_ => unreachable!(),
39-
};
40-
DiskFileError::Size(io_inner)
41-
})
42-
}
43-
44-
fn new_async_io(&self, _ring_depth: u32) -> DiskFileResult<Box<dyn AsyncIo>> {
45-
Ok(Box::new(
46-
FixedVhdSync::new(self.0.as_raw_fd(), self.0.logical_size().unwrap())
47-
.map_err(DiskFileError::NewAsyncIo)?,
48-
) as Box<dyn AsyncIo>)
49-
}
50-
51-
fn fd(&mut self) -> BorrowedDiskFd<'_> {
52-
BorrowedDiskFd::new(self.0.as_raw_fd())
53-
}
54-
}
55-
5627
impl disk_file::DiskSize for FixedVhdDiskSync {
5728
fn logical_size(&self) -> BlockResult<u64> {
5829
Ok(self.0.logical_size().unwrap())

0 commit comments

Comments
 (0)