diff --git a/block/src/disk_file.rs b/block/src/disk_file.rs index 31c5ee085..9dd52be6d 100644 --- a/block/src/disk_file.rs +++ b/block/src/disk_file.rs @@ -35,8 +35,8 @@ use std::fmt::Debug; -use crate::BlockResult; use crate::async_io::BorrowedDiskFd; +use crate::{BlockResult, DiskTopology}; /// Reported capacity of a disk image. pub trait DiskSize: Send + Debug { @@ -55,3 +55,13 @@ pub trait DiskFd: Send + Debug { /// Borrows the underlying file descriptor. fn fd(&self) -> BorrowedDiskFd<'_>; } + +/// Sector and cluster geometry of a disk image. +/// +/// Default returns `DiskTopology::default()` (512B logical/physical). +pub trait Geometry: Send + Debug { + /// Returns the disk topology. + fn topology(&self) -> DiskTopology { + DiskTopology::default() + } +}