From fe39929a2ad751a7985828bbb240c4a9d8b7105e Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Tue, 24 Mar 2026 17:35:52 -0700 Subject: [PATCH] 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 --- block/src/raw_sync.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/block/src/raw_sync.rs b/block/src/raw_sync.rs index c6f30f53e..5a6a65b36 100644 --- a/block/src/raw_sync.rs +++ b/block/src/raw_sync.rs @@ -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,