diff options
author | Ross Williams <ross@ross-williams.net> | 2019-09-03 18:21:33 +0000 |
---|---|---|
committer | Ross Williams <ross@ross-williams.net> | 2019-09-03 18:21:33 +0000 |
commit | e450b586368750e771746ef3e2f5a070962dfd28 (patch) | |
tree | 5501777912872ee233b6c9b60a26dd4906a6b4a7 /freebsd | |
parent | ff6914e4ad4b78749bcee5471a33ef206b0a7d03 (diff) |
Refactor openzfs_sysctl_init() and ZfsArcMeter...
openzfs_sysctl_init() now returns void instead of int.
The ZfsArcStats->enabled flag is set inside the init function
now, instead of having to be set from its return value.
Preparation for more flag setting in Compressed ARC commit.
ZfsArcMeter_readStats() added and all Meter->values[] setting
moved to it, eliminating duplicated code in
{darwin,freebsd,linux,solaris}/Platform.c.
Diffstat (limited to 'freebsd')
-rw-r--r-- | freebsd/FreeBSDProcessList.c | 2 | ||||
-rw-r--r-- | freebsd/Platform.c | 13 |
2 files changed, 2 insertions, 13 deletions
diff --git a/freebsd/FreeBSDProcessList.c b/freebsd/FreeBSDProcessList.c index 1cbfdaab..fd694198 100644 --- a/freebsd/FreeBSDProcessList.c +++ b/freebsd/FreeBSDProcessList.c @@ -118,7 +118,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui len = 2; sysctlnametomib("vfs.bufspace", MIB_vfs_bufspace, &len); - fpl->zfs.enabled = openzfs_sysctl_init(); + openzfs_sysctl_init(&fpl->zfs); openzfs_sysctl_updateArcStats(&fpl->zfs); int smp = 0; diff --git a/freebsd/Platform.c b/freebsd/Platform.c index 05c0e922..b08a508e 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -202,18 +202,7 @@ void Platform_setSwapValues(Meter* this) { void Platform_setZfsArcValues(Meter* this) { FreeBSDProcessList* fpl = (FreeBSDProcessList*) this->pl; - this->total = fpl->zfs.max; - this->values[0] = fpl->zfs.MFU; - this->values[1] = fpl->zfs.MRU; - this->values[2] = fpl->zfs.anon; - this->values[3] = fpl->zfs.header; - this->values[4] = fpl->zfs.other; - - // "Hide" the last value so it can - // only be accessed by index and is not - // displayed by the Bar or Graph style - Meter_setItems(this, 5); - this->values[5] = fpl->zfs.size; + ZfsArcMeter_readStats(this, &(fpl->zfs)); } void Platform_setTasksValues(Meter* this) { |