summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6f05908)
raw | patch | inline | side by side (parent: 6f05908)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Wed, 27 Apr 2016 09:44:22 +0000 (11:44 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Wed, 27 Apr 2016 09:44:22 +0000 (11:44 +0200) |
src/zfs_arc.c | patch | blob | history |
diff --git a/src/zfs_arc.c b/src/zfs_arc.c
index e1c39372b55c7996eef6fc11d1f24556792e6192..300fda2ef8937fad1d9e0d29fd2d7d5263c2c11d 100644 (file)
--- a/src/zfs_arc.c
+++ b/src/zfs_arc.c
llist_destroy (ksp);
}
-#elif !defined(__FreeBSD__) // Solaris
+#elif defined(KERNEL_SOLARIS)
extern kstat_ctl_t *kc;
static long long get_zfs_value(kstat_t *ksp, char *name)
return (get_kstat_value(ksp, name));
}
-#else // FreeBSD
+#elif defined(KERNEL_FREEBSD)
#include <sys/types.h>
#include <sys/sysctl.h>
value_t l2_io[2];
kstat_t *ksp = NULL;
-#if KERNEL_LINUX
+#if defined(KERNEL_LINUX)
FILE *fh;
char buffer[1024];
fclose (fh);
-#elif !defined(__FreeBSD__) // Solaris
+#elif defined(KERNEL_SOLARIS)
get_kstat (&ksp, "zfs", 0, "arcstats");
if (ksp == NULL)
{
/* Operations */
za_read_derive (ksp, "deleted", "cache_operation", "deleted");
-#if __FreeBSD__
+#if defined(KERNEL_FREEBSD)
za_read_derive (ksp, "allocated","cache_operation", "allocated");
-#if defined(__FreeBSD_version) && (__FreeBSD_version < 1002501)
+#if __FreeBSD_version < 1002501
/* stolen removed from sysctl kstat.zfs.misc.arcstats on FreeBSD 10.2+ */
za_read_derive (ksp, "stolen", "cache_operation", "stolen");
#endif
static int za_init (void) /* {{{ */
{
-#if !defined(__FreeBSD__) && !defined(KERNEL_LINUX) // Solaris
+#if defined(KERNEL_SOLARIS)
/* kstats chain already opened by update_kstat (using *kc), verify everything went fine. */
if (kc == NULL)
{