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

Method write_vectored

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

Source from the content-addressed store, hash-verified

64 }
65
66 fn write_vectored(
67 &mut self,
68 offset: libc::off_t,
69 iovecs: &[libc::iovec],
70 user_data: u64,
71 ) -> AsyncIoResult<()> {
72 // SAFETY: FFI call with valid arguments
73 let result = unsafe {
74 libc::pwritev(
75 self.fd as libc::c_int,
76 iovecs.as_ptr(),
77 iovecs.len() as libc::c_int,
78 offset,
79 )
80 };
81 if result < 0 {
82 return Err(AsyncIoError::WriteVectored(std::io::Error::last_os_error()));
83 }
84
85 self.completion_list.push_back((user_data, result as i32));
86 self.eventfd.write(1).unwrap();
87
88 Ok(())
89 }
90
91 fn fsync(&mut self, user_data: Option<u64>) -> AsyncIoResult<()> {
92 // SAFETY: FFI call

Callers 3

micro_bench_aio_drainFunction · 0.45
submit_writesFunction · 0.45
execute_asyncMethod · 0.45

Calls 2

lenMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected