diff options
author | rbuj <[email protected]> | 2019-04-13 11:20:43 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-04-15 18:12:18 +0200 |
commit | 210f1efb1ec52b9f371a01b8f6ae4ce2aa219472 (patch) | |
tree | 2197ca7f6949c67752c8873723f04b88e8cc840d | |
parent | ed02d9121529beb50a709d50f01bba6b8f578795 (diff) | |
download | mate-system-monitor-210f1efb1ec52b9f371a01b8f6ae4ce2aa219472.tar.bz2 mate-system-monitor-210f1efb1ec52b9f371a01b8f6ae4ce2aa219472.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
-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; |