block: Implement SparseCapable trait for RawFileDiskSync

Add disk_file::SparseCapable trait implementation for
RawFileDiskSync. Delegates to probe_sparse_support() to
detect whether the underlying file supports hole-punching.

Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
Muminul Islam
2026-03-24 17:35:52 -07:00
committed by Bo Chen
parent aa5aa6fe89
commit fe39929a2a

View File

@@ -96,6 +96,12 @@ impl disk_file::Geometry for RawFileDiskSync {
}
}
impl disk_file::SparseCapable for RawFileDiskSync {
fn supports_sparse_operations(&self) -> bool {
probe_sparse_support(&self.file)
}
}
pub struct RawFileSync {
fd: RawFd,
eventfd: EventFd,