Skip to content

Commit 5041290

Browse files
committed
chore: remove unused get_all_filesystems function
1 parent 2a8e15d commit 5041290

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

src/metrics/fs.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
use anyhow::{Context, Result};
44
use nix::sys::statvfs::statvfs;
5-
use std::collections::HashMap;
65
use std::path::Path;
76

87
/// Represents filesystem usage information for a specific mount point.
@@ -148,37 +147,3 @@ impl FilesystemUsage {
148147
1.0 - self.usage_ratio
149148
}
150149
}
151-
152-
/// Returns a map of all mounted filesystems and their usage information.
153-
///
154-
/// # Returns
155-
/// A map of mount points to their usage information or an error if the information cannot be
156-
/// retrieved.
157-
pub async fn get_all_filesystems() -> Result<HashMap<String, FilesystemUsage>> {
158-
let mut ret = HashMap::new();
159-
let mounts = smol::unblock(|| procfs::mounts().context("reading /proc/mounts")).await?;
160-
161-
for mount in mounts.iter() {
162-
let mount_point = &mount.fs_spec;
163-
164-
// Skip pseudo filesystems
165-
if mount_point.starts_with("/proc")
166-
|| mount_point.starts_with("/sys")
167-
|| mount_point.starts_with("/dev")
168-
|| mount_point.starts_with("/run")
169-
{
170-
continue;
171-
}
172-
173-
match FilesystemUsage::new(mount_point).await {
174-
Ok(usage) => {
175-
ret.insert(mount_point.to_string(), usage);
176-
}
177-
Err(_) => {
178-
// Skip filesystems we can't get stats for
179-
}
180-
}
181-
}
182-
183-
Ok(ret)
184-
}

0 commit comments

Comments
 (0)