From ed9a35324d79264596e7cd1a638b1df7d22fa5e9 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 17 Dec 2008 11:32:47 -0800 Subject: [PATCH 1/2] Not sure why Sun needed to remove these externs, but I need them back --- lib/libzpool/include/sys/zfs_context.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libzpool/include/sys/zfs_context.h b/lib/libzpool/include/sys/zfs_context.h index 526b8e1fa0..b68078add3 100644 --- a/lib/libzpool/include/sys/zfs_context.h +++ b/lib/libzpool/include/sys/zfs_context.h @@ -315,11 +315,14 @@ typedef void (task_func_t)(void *); #define TQ_NOSLEEP KM_NOSLEEP /* cannot block for memory; may fail */ #define TQ_NOQUEUE 0x02 /* Do not enqueue if can't dispatch */ +extern taskq_t *system_taskq; + extern taskq_t *taskq_create(const char *, int, pri_t, int, int, uint_t); extern taskqid_t taskq_dispatch(taskq_t *, task_func_t, void *, uint_t); extern void taskq_destroy(taskq_t *); extern void taskq_wait(taskq_t *); extern int taskq_member(taskq_t *, void *); +extern void system_taskq_init(void); #define XVA_MAPSIZE 3 #define XVA_MAGIC 0x78766174 From 8af904a4b0e1885bdd4527ce3be33b61680a3785 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 17 Dec 2008 11:34:19 -0800 Subject: [PATCH 2/2] Resolve index shadowing /usr/include/string.h:304 --- lib/libzpool/util.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libzpool/util.c b/lib/libzpool/util.c index 781edb6e8a..ecc3752bbc 100644 --- a/lib/libzpool/util.c +++ b/lib/libzpool/util.c @@ -41,24 +41,24 @@ void nicenum(uint64_t num, char *buf) { uint64_t n = num; - int index = 0; + int i = 0; char u; while (n >= 1024) { n = (n + (1024 / 2)) / 1024; /* Round up or down */ - index++; + i++; } - u = " KMGTPE"[index]; + u = " KMGTPE"[i]; - if (index == 0) { + if (i == 0) { (void) sprintf(buf, "%llu", (u_longlong_t)n); } else if (n < 10 && (num & (num - 1)) != 0) { (void) sprintf(buf, "%.2f%c", - (double)num / (1ULL << 10 * index), u); + (double)num / (1ULL << 10 * i), u); } else if (n < 100 && (num & (num - 1)) != 0) { (void) sprintf(buf, "%.1f%c", - (double)num / (1ULL << 10 * index), u); + (double)num / (1ULL << 10 * i), u); } else { (void) sprintf(buf, "%llu%c", (u_longlong_t)n, u); }