Refactor common OpenZFS sysctl access

Darwin and FreeBSD export zfs kstats through the
same APIs, so moving functions into a common file.
This commit is contained in:
Ross Williams
2019-07-07 23:27:00 +00:00
parent fc8e9a2d3e
commit a88d2e313d
15 changed files with 215 additions and 223 deletions

View File

@ -36,10 +36,6 @@ TasksMeter.h UptimeMeter.h TraceScreen.h UsersTable.h Vector.h Process.h \
AffinityPanel.h HostnameMeter.h OpenFilesScreen.h Affinity.h IncSet.h Action.h \
EnvScreen.h InfoScreen.h XAlloc.h
zfs_platform_sources = zfs/ZfsArcMeter.c
zfs_platform_headers = zfs/ZfsArcMeter.h
all_platform_headers =
# Linux
@ -53,7 +49,8 @@ linux_platform_headers = \
linux/LinuxProcessList.h \
linux/LinuxCRT.h \
linux/Battery.h \
$(zfs_platform_headers)
zfs/ZfsArcMeter.h \
zfs/ZfsArcStats.h
all_platform_headers += $(linux_platform_headers)
@ -61,7 +58,7 @@ if HTOP_LINUX
AM_CFLAGS += -rdynamic
myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c linux/IOPriority.c \
linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c \
$(zfs_platform_sources)
zfs/ZfsArcMeter.c zfs/ZfsArcStats.c
myhtopplatheaders = $(linux_platform_headers)
endif
@ -75,14 +72,16 @@ freebsd_platform_headers = \
freebsd/FreeBSDProcess.h \
freebsd/FreeBSDCRT.h \
freebsd/Battery.h \
$(zfs_platform_headers)
zfs/ZfsArcMeter.h \
zfs/ZfsArcStats.h \
zfs/openzfs_sysctl.h
all_platform_headers += $(freebsd_platform_headers)
if HTOP_FREEBSD
myhtopplatsources = freebsd/Platform.c freebsd/FreeBSDProcessList.c \
freebsd/FreeBSDProcess.c freebsd/FreeBSDCRT.c freebsd/Battery.c \
$(zfs_platform_sources)
zfs/ZfsArcMeter.c zfs/ZfsArcStats.c zfs/openzfs_sysctl.c
myhtopplatheaders = $(freebsd_platform_headers)
endif
@ -135,7 +134,9 @@ darwin_platform_headers = \
darwin/DarwinProcessList.h \
darwin/DarwinCRT.h \
darwin/Battery.h \
$(zfs_platform_headers)
zfs/ZfsArcMeter.h \
zfs/ZfsArcStats.h \
zfs/openzfs_sysctl.h
all_platform_headers += $(darwin_platform_headers)
@ -143,7 +144,7 @@ if HTOP_DARWIN
AM_LDFLAGS += -framework IOKit -framework CoreFoundation
myhtopplatsources = darwin/Platform.c darwin/DarwinProcess.c \
darwin/DarwinProcessList.c darwin/DarwinCRT.c darwin/Battery.c \
$(zfs_platform_sources)
zfs/ZfsArcMeter.c zfs/ZfsArcStats.c zfs/openzfs_sysctl.c
myhtopplatheaders = $(darwin_platform_headers)
endif