mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Add read_vectored_at and write_vectored_at to AlignedFile. They take the aligned fast path with a single preadv or pwritev when the offset and every iovec base and length satisfy the O_DIRECT alignment, and otherwise bounce through an AlignedBuffer, scattering on read and gathering with a read-modify-write on write. Convert the raw sync engine to these methods and drop its raw preadv and pwritev block. The methods are unsafe because their soundness depends on the caller passing iovecs that describe valid memory for iov_len bytes. Signed-off-by: Anatol Belski <anbelski@linux.microsoft.com>