From b7cf8737acbaeed0cb80129d468a4a0e773d2785 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Fri, 27 Mar 2026 23:49:15 -0700 Subject: [PATCH] block: Implement SparseCapable trait for RawFileDiskAio Add disk_file::SparseCapable trait implementation for RawFileDiskAio. Delegates to probe_sparse_support() to detect whether the underlying file supports hole-punching. Signed-off-by: Muminul Islam --- block/src/raw_async_aio.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/block/src/raw_async_aio.rs b/block/src/raw_async_aio.rs index 6c1fe0aad..b12469312 100644 --- a/block/src/raw_async_aio.rs +++ b/block/src/raw_async_aio.rs @@ -101,6 +101,12 @@ impl disk_file::Geometry for RawFileDiskAio { } } +impl disk_file::SparseCapable for RawFileDiskAio { + fn supports_sparse_operations(&self) -> bool { + probe_sparse_support(&self.file) + } +} + pub struct RawFileAsyncAio { fd: RawFd, ctx: aio::IoContext,