Skip to content

Commit df89059

Browse files
russell-islamliuw
authored andcommitted
block: Implement DiskFd trait for RawFileDiskAio
Add disk_file::DiskFd trait implementation for RawFileDiskAio. Delegates to file.as_raw_fd() via BorrowedDiskFd, taking &self instead of &mut self. Signed-off-by: Muminul Islam <muislam@microsoft.com>
1 parent 78bbdbe commit df89059

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
@@ -86,6 +86,12 @@ impl disk_file::PhysicalSize for RawFileDiskAio {
8686
}
8787
}
8888

89+
impl disk_file::DiskFd for RawFileDiskAio {
90+
fn fd(&self) -> BorrowedDiskFd<'_> {
91+
BorrowedDiskFd::new(self.file.as_raw_fd())
92+
}
93+
}
94+
8995
pub struct RawFileAsyncAio {
9096
fd: RawFd,
9197
ctx: aio::IoContext,

0 commit comments

Comments
 (0)