From aac240d07663b50147cdee0d4856a8c6feca70b3 Mon Sep 17 00:00:00 2001 From: Thomas Prescher Date: Tue, 11 Nov 2025 09:41:48 +0100 Subject: [PATCH] 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 --- block/src/raw_async.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/src/raw_async.rs b/block/src/raw_async.rs index f62c563d2..e36f249e8 100644 --- a/block/src/raw_async.rs +++ b/block/src/raw_async.rs @@ -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()) }