From: hume-github Date: Tue, 18 Sep 2012 18:12:25 +0000 (-0300) Subject: Multithreading fix: localize unneeded global variable X-Git-Tag: collectd-5.0.5~4^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4aef026a3cb088e937871f8de32ed5fbd472296a;p=collectd.git Multithreading fix: localize unneeded global variable --- diff --git a/src/zfs_arc.c b/src/zfs_arc.c index 5f14e909..79a234f4 100644 --- a/src/zfs_arc.c +++ b/src/zfs_arc.c @@ -26,7 +26,7 @@ /* * Global variables */ -static kstat_t *ksp; + extern kstat_ctl_t *kc; static void za_submit (const char* type, const char* type_instance, value_t* values, int values_len) @@ -94,6 +94,7 @@ static int za_read (void) counter_t demand_data_hits, demand_metadata_hits, prefetch_data_hits, prefetch_metadata_hits; counter_t demand_data_misses, demand_metadata_misses, prefetch_data_misses, prefetch_metadata_misses; counter_t l2_read_bytes, l2_write_bytes; + kstat_t *ksp = NULL; get_kstat (&ksp, "zfs", 0, "arcstats"); if (ksp == NULL) @@ -145,8 +146,6 @@ static int za_read (void) static int za_init (void) /* {{{ */ { - ksp = NULL; - /* kstats chain already opened by update_kstat (using *kc), verify everything went fine. */ if (kc == NULL) {