From: Ruben Kerkhof Date: Wed, 27 Apr 2016 09:44:22 +0000 (+0200) Subject: zfs_arc plugin: cleanup defines X-Git-Tag: collectd-5.6.0~316 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2169fe0237481355d4a05bc20eda34cfe906e802;p=collectd.git zfs_arc plugin: cleanup defines --- diff --git a/src/zfs_arc.c b/src/zfs_arc.c index e1c39372..300fda2e 100644 --- a/src/zfs_arc.c +++ b/src/zfs_arc.c @@ -103,7 +103,7 @@ static void free_zfs_values (kstat_t *ksp) 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) @@ -111,7 +111,7 @@ static long long get_zfs_value(kstat_t *ksp, char *name) return (get_kstat_value(ksp, name)); } -#else // FreeBSD +#elif defined(KERNEL_FREEBSD) #include #include @@ -219,7 +219,7 @@ static int za_read (void) value_t l2_io[2]; kstat_t *ksp = NULL; -#if KERNEL_LINUX +#if defined(KERNEL_LINUX) FILE *fh; char buffer[1024]; @@ -259,7 +259,7 @@ static int za_read (void) fclose (fh); -#elif !defined(__FreeBSD__) // Solaris +#elif defined(KERNEL_SOLARIS) get_kstat (&ksp, "zfs", 0, "arcstats"); if (ksp == NULL) { @@ -284,9 +284,9 @@ static int za_read (void) /* 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 @@ -335,7 +335,7 @@ static int za_read (void) 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) {