MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / create_async_io

Method create_async_io

block/src/raw_disk.rs:130–143  ·  view source on GitHub ↗
(&self, ring_depth: u32)

Source from the content-addressed store, hash-verified

128 }
129
130 fn create_async_io(&self, ring_depth: u32) -> BlockResult<Box<dyn AsyncIo>> {
131 match self.backend {
132 RawBackend::Sync => Ok(Box::new(RawFileSync::new(self.file.as_raw_fd()))),
133 #[cfg(feature = "io_uring")]
134 RawBackend::IoUring => Ok(Box::new(RawFileAsync::new(
135 self.file.as_raw_fd(),
136 ring_depth,
137 )?)),
138 RawBackend::Aio => Ok(Box::new(RawFileAsyncAio::new(
139 self.file.as_raw_fd(),
140 ring_depth,
141 )?)),
142 }
143 }
144}
145
146#[cfg(test)]

Calls 2

newFunction · 0.85
as_raw_fdMethod · 0.45