diff options
Diffstat (limited to 'include/sys/zfs_context.h')
-rw-r--r-- | include/sys/zfs_context.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h index 599b97a9b..a126c058e 100644 --- a/include/sys/zfs_context.h +++ b/include/sys/zfs_context.h @@ -209,8 +209,6 @@ typedef struct kthread { void * t_arg; } kthread_t; -#define tsd_get(key) pthread_getspecific(key) -#define tsd_set(key, val) pthread_setspecific(key, val) #define curthread zk_thread_current() #define thread_exit zk_thread_exit #define thread_create(stk, stksize, func, arg, len, pp, state, pri) \ @@ -284,6 +282,12 @@ typedef int krw_t; #define RW_WRITE_HELD(x) ((x)->rw_wr_owner == curthread) #define RW_LOCK_HELD(x) (RW_READ_HELD(x) || RW_WRITE_HELD(x)) +#undef RW_LOCK_HELD +#define RW_LOCK_HELD(x) (RW_READ_HELD(x) || RW_WRITE_HELD(x)) + +#undef RW_LOCK_HELD +#define RW_LOCK_HELD(x) (RW_READ_HELD(x) || RW_WRITE_HELD(x)) + extern void rw_init(krwlock_t *rwlp, char *name, int type, void *arg); extern void rw_destroy(krwlock_t *rwlp); extern void rw_enter(krwlock_t *rwlp, krw_t rw); @@ -321,6 +325,22 @@ extern void cv_broadcast(kcondvar_t *cv); #define cv_wait_io(cv, mp) cv_wait(cv, mp) /* + * Thread-specific data + */ +#define tsd_get(k) pthread_getspecific(k) +#define tsd_set(k, v) pthread_setspecific(k, v) +#define tsd_create(kp, d) pthread_key_create(kp, d) +#define tsd_destroy(kp) /* nothing */ + +/* + * Thread-specific data + */ +#define tsd_get(k) pthread_getspecific(k) +#define tsd_set(k, v) pthread_setspecific(k, v) +#define tsd_create(kp, d) pthread_key_create(kp, d) +#define tsd_destroy(kp) /* nothing */ + +/* * kstat creation, installation and deletion */ extern kstat_t *kstat_create(char *, int, @@ -592,7 +612,7 @@ typedef struct callb_cpr { extern char *kmem_vasprintf(const char *fmt, va_list adx); extern char *kmem_asprintf(const char *fmt, ...); -#define strfree(str) kmem_free((str), strlen(str)+1) +#define strfree(str) kmem_free((str), strlen(str) + 1) /* * Hostname information |