From 899dec4c0433f98f039c30409efc7036b382c4d4 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Tue, 24 Mar 2026 17:25:05 -0700 Subject: [PATCH] block: Implement SparseCapable trait for RawFileDisk Add disk_file::SparseCapable trait implementation for RawFileDisk. Delegates to probe_sparse_support() to detect whether the underlying file supports hole-punching. Signed-off-by: Muminul Islam --- block/src/raw_async.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/block/src/raw_async.rs b/block/src/raw_async.rs index e5ba96de3..86f23b1fa 100644 --- a/block/src/raw_async.rs +++ b/block/src/raw_async.rs @@ -105,6 +105,12 @@ impl disk_file::Geometry for RawFileDisk { } } +impl disk_file::SparseCapable for RawFileDisk { + fn supports_sparse_operations(&self) -> bool { + probe_sparse_support(&self.file) + } +} + pub struct RawFileAsync { fd: RawFd, io_uring: IoUring,