diff --git a/src/unix/freebsd/disk.rs b/src/unix/freebsd/disk.rs index ab3908854..c19ce8f8e 100644 --- a/src/unix/freebsd/disk.rs +++ b/src/unix/freebsd/disk.rs @@ -58,6 +58,11 @@ impl DiskInner { refresh_disk(self, &mut vfs) } } + + pub(crate) fn usage(&self) -> DiskUsage { + // TODO: Until disk i/o stats are added, return the default + DiskUsage::default() + } } impl crate::DisksInner { @@ -78,6 +83,12 @@ impl crate::DisksInner { pub(crate) fn list_mut(&mut self) -> &mut [Disk] { &mut self.disks } + + pub(crate) fn refresh(&mut self) { + for disk in self.list_mut() { + disk.refresh(); + } + } } // FIXME: if you want to get disk I/O usage: diff --git a/src/unknown/disk.rs b/src/unknown/disk.rs index af2183f1f..901c3114b 100644 --- a/src/unknown/disk.rs +++ b/src/unknown/disk.rs @@ -42,6 +42,10 @@ impl DiskInner { pub(crate) fn refresh(&mut self) -> bool { true } + + pub(crate) fn usage(&self) -> DiskUsage { + unreachable!() + } } pub(crate) struct DisksInner { @@ -65,6 +69,10 @@ impl DisksInner { // Does nothing. } + pub(crate) fn refresh(&mut self) { + // Does nothing. + } + pub(crate) fn list(&self) -> &[Disk] { &self.disks }