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

Method read_vectored

block/src/raw_sync.rs:41–64  ·  view source on GitHub ↗
(
        &mut self,
        offset: libc::off_t,
        iovecs: &[libc::iovec],
        user_data: u64,
    )

Source from the content-addressed store, hash-verified

39 }
40
41 fn read_vectored(
42 &mut self,
43 offset: libc::off_t,
44 iovecs: &[libc::iovec],
45 user_data: u64,
46 ) -> AsyncIoResult<()> {
47 // SAFETY: FFI call with valid arguments
48 let result = unsafe {
49 libc::preadv(
50 self.fd as libc::c_int,
51 iovecs.as_ptr(),
52 iovecs.len() as libc::c_int,
53 offset,
54 )
55 };
56 if result < 0 {
57 return Err(AsyncIoError::ReadVectored(std::io::Error::last_os_error()));
58 }
59
60 self.completion_list.push_back((user_data, result as i32));
61 self.eventfd.write(1).unwrap();
62
63 Ok(())
64 }
65
66 fn write_vectored(
67 &mut self,

Callers 4

submit_readsFunction · 0.45
execute_asyncMethod · 0.45

Calls 2

lenMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected