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

Function collect_extents

vmm/src/memory_manager.rs:3330–3342  ·  view source on GitHub ↗
(
        fd: BorrowedFd<'_>,
        start: u64,
        end: u64,
    )

Source from the content-addressed store, hash-verified

3328 }
3329
3330 fn collect_extents(
3331 fd: BorrowedFd<'_>,
3332 start: u64,
3333 end: u64,
3334 ) -> std::io::Result<Vec<(u64, u64)>> {
3335 let mut out = Vec::new();
3336 let mut cursor = start;
3337 while let Some((off, len)) = next_data_extent(fd, cursor, end)? {
3338 out.push((off, len));
3339 cursor = off + len;
3340 }
3341 Ok(out)
3342 }
3343
3344 /// Punch an explicit hole into `f`. Tests use this instead of relying on
3345 /// "didn't write here" to mean "is a hole": modern shmem/tmpfs may

Calls 3

newFunction · 0.85
next_data_extentFunction · 0.85
pushMethod · 0.45