diff options
author | rbuj <[email protected]> | 2019-04-13 11:20:43 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-04-15 18:19:01 +0200 |
commit | 4a1ac5cc8103a51bcbd18623b9285a80eb2b48d7 (patch) | |
tree | 3bfd7b93cfebb9689e68f99a9233ef458a213fd8 /src | |
parent | cf667502a0ee315442fe281416eee66d8f66500c (diff) | |
download | mate-system-monitor-4a1ac5cc8103a51bcbd18623b9285a80eb2b48d7.tar.bz2 mate-system-monitor-4a1ac5cc8103a51bcbd18623b9285a80eb2b48d7.tar.xz |
Show available disk space in ZFS
Applied patch:
https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/desktop/mate/mate-system-monitor/patches/01-zfs.patch
Requires this patch on distributions of GNU/Linux:
https://gitlab.gnome.org/GNOME/libgtop/merge_requests/6
Fixes #120
Diffstat (limited to 'src')
-rw-r--r-- | src/sysinfo.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sysinfo.cpp b/src/sysinfo.cpp index 5c40a2e..0290e9b 100644 --- a/src/sysinfo.cpp +++ b/src/sysinfo.cpp @@ -279,6 +279,14 @@ namespace { this->free_space_bytes = 0; for (guint i = 0; i != mountlist.number; ++i) { + if ((string(entries[i].mountdir).compare("/") == 0) && \ + (string(entries[i].type).compare("zfs") == 0)) { + // Root filesystem is ZFS based: Calculate usage based on "/". + glibtop_fsusage usage; + glibtop_get_fsusage(&usage, "/"); + this->free_space_bytes = usage.bavail * usage.block_size; + break; + } if (string(entries[i].devname).find("/dev/") != 0) continue; |