List the device containing the filesystem mounted at the given directory.
(dir: &Dir)
| 496 | |
| 497 | /// List the device containing the filesystem mounted at the given directory. |
| 498 | pub fn list_dev_by_dir(dir: &Dir) -> Result<Device> { |
| 499 | let fsinfo = bootc_mount::inspect_filesystem_of_dir(dir)?; |
| 500 | let source = &fsinfo.source; |
| 501 | if fsinfo.fstype == "zfs" || source.starts_with("ZFS=") { |
| 502 | return list_dev_for_zfs_dataset(source); |
| 503 | } |
| 504 | list_dev(&Utf8PathBuf::from(source)) |
| 505 | } |
| 506 | |
| 507 | pub struct LoopbackDevice { |
| 508 | pub dev: Option<Utf8PathBuf>, |
no test coverage detected