MCPcopy Create free account
hub / github.com/bootc-dev/bootc / list_dev_by_dir

Function list_dev_by_dir

crates/blockdev/src/blockdev.rs:498–505  ·  view source on GitHub ↗

List the device containing the filesystem mounted at the given directory.

(dir: &Dir)

Source from the content-addressed store, hash-verified

496
497/// List the device containing the filesystem mounted at the given directory.
498pub 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
507pub struct LoopbackDevice {
508 pub dev: Option<Utf8PathBuf>,

Callers 5

mount_esp_partFunction · 0.85
run_from_optFunction · 0.85
newMethod · 0.85
setup_composefs_bls_bootFunction · 0.85
setup_composefs_uki_bootFunction · 0.85

Calls 3

list_dev_for_zfs_datasetFunction · 0.85
list_devFunction · 0.85

Tested by

no test coverage detected