File tree Expand file tree Collapse file tree 1 file changed +0
-35
lines changed Expand file tree Collapse file tree 1 file changed +0
-35
lines changed Original file line number Diff line number Diff line change 2
2
3
3
use anyhow:: { Context , Result } ;
4
4
use nix:: sys:: statvfs:: statvfs;
5
- use std:: collections:: HashMap ;
6
5
use std:: path:: Path ;
7
6
8
7
/// Represents filesystem usage information for a specific mount point.
@@ -148,37 +147,3 @@ impl FilesystemUsage {
148
147
1.0 - self . usage_ratio
149
148
}
150
149
}
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
- }
You can’t perform that action at this time.
0 commit comments