block: raw_async: implement disk resizing

Support for resize events for raw_async disks.

On-behalf-of: SAP thomas.prescher@sap.com
Signed-off-by: Thomas Prescher <thomas.prescher@cyberus-technology.de>
This commit is contained in:
Thomas Prescher
2025-11-11 09:41:48 +01:00
committed by Rob Bradford
parent 37d71fa038
commit aac240d076

View File

@@ -55,6 +55,10 @@ impl DiskFile for RawFileDisk {
}
}
fn resize(&mut self, size: u64) -> DiskFileResult<()> {
self.file.set_len(size).map_err(DiskFileError::ResizeError)
}
fn fd(&mut self) -> BorrowedDiskFd<'_> {
BorrowedDiskFd::new(self.file.as_raw_fd())
}