Skip to content

Commit b7cf873

Browse files
russell-islamliuw
authored andcommitted
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 <muislam@microsoft.com>
1 parent 190380c commit b7cf873

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

block/src/raw_async_aio.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ impl disk_file::Geometry for RawFileDiskAio {
101101
}
102102
}
103103

104+
impl disk_file::SparseCapable for RawFileDiskAio {
105+
fn supports_sparse_operations(&self) -> bool {
106+
probe_sparse_support(&self.file)
107+
}
108+
}
109+
104110
pub struct RawFileAsyncAio {
105111
fd: RawFd,
106112
ctx: aio::IoContext,

0 commit comments

Comments
 (0)