(
fd: BorrowedFd<'_>,
start: u64,
end: u64,
)
| 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 |