(f: &File)
| 2505 | } |
| 2506 | |
| 2507 | pub fn is_hardlink(f: &File) -> bool { |
| 2508 | let mut stat = std::mem::MaybeUninit::<libc::stat>::uninit(); |
| 2509 | // SAFETY: FFI call with correct arguments |
| 2510 | let ret = unsafe { libc::fstat(f.as_raw_fd(), stat.as_mut_ptr()) }; |
| 2511 | if ret != 0 { |
| 2512 | error!("Couldn't fstat the backing file"); |
| 2513 | return false; |
| 2514 | } |
| 2515 | |
| 2516 | // SAFETY: stat is valid |
| 2517 | unsafe { (*stat.as_ptr()).st_nlink as usize > 0 } |
| 2518 | } |
| 2519 | |
| 2520 | pub fn virtio_mem_plugged_size(&self) -> u64 { |
| 2521 | self.memory_zones |
nothing calls this directly
no test coverage detected