patches/gnome-system-monitor-03-zfs.diff
author Jon Tibble <meths@btinternet.com>
Sat, 06 Oct 2012 16:11:50 +0100
branchs11express-2010-11
changeset 22109 db10202d5f6d
parent 15641 ec41a0f5a07e
permissions -rw-r--r--
Added tag oi_151a_prestable7 for changeset 25dee50cecca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15641
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
     1
--- gnome-system-monitor-2.26.1/src/sysinfo.cpp	2009-04-16 11:44:31.402219136 +0100
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
     2
+++ gnome-system-monitor-2.26.1-new/src/sysinfo.cpp	2009-04-16 11:46:28.735986864 +0100
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
     3
@@ -126,6 +126,14 @@ namespace {
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
     4
       this->free_space_bytes = 0;
14931
6f64583d03f6 +2009-01-19 henry <[email protected]>
henryz
parents:
diff changeset
     5
 
15641
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
     6
       for (guint i = 0; i != mountlist.number; ++i) {
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
     7
+        if ((string(entries[i].mountdir).compare("/") == 0) && \
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
     8
+            (string(entries[i].type).compare("zfs") == 0)) {    
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
     9
+      // Root filesystem is ZFS based: Calculate usage based on "/".
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
    10
+      glibtop_fsusage usage;
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
    11
+      glibtop_get_fsusage(&usage, "/");
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
    12
+      this->free_space_bytes = usage.bavail * usage.block_size;       
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
    13
+          break;
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
    14
+        }
14931
6f64583d03f6 +2009-01-19 henry <[email protected]>
henryz
parents:
diff changeset
    15
 
15641
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
    16
 	if (string(entries[i].devname).find("/dev/") != 0)
ec41a0f5a07e 2009-04-16 Niall Power <[email protected]>
niall
parents: 15295
diff changeset
    17
 	  continue;