From f41626ced690778df009c50d2da5e3456a479f1c Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 22 Dec 2008 13:46:30 -0800 Subject: [PATCH 1/3] Make ZPL conditional --- module/zfs/rrwlock.c | 4 ---- module/zfs/zfs_acl.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/module/zfs/rrwlock.c b/module/zfs/rrwlock.c index 7bce5dd8d7..710685dbc7 100644 --- a/module/zfs/rrwlock.c +++ b/module/zfs/rrwlock.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#ifdef HAVE_ZPL - #pragma ident "%Z%%M% %I% %E% SMI" #include @@ -249,5 +247,3 @@ rrw_held(rrwlock_t *rrl, krw_t rw) return (held); } - -#endif /* HAVE_ZPL */ diff --git a/module/zfs/zfs_acl.c b/module/zfs/zfs_acl.c index 341dc4dfe7..1299e73793 100644 --- a/module/zfs/zfs_acl.c +++ b/module/zfs/zfs_acl.c @@ -23,6 +23,8 @@ * Use is subject to license terms. */ +#ifdef HAVE_ZPL + #include #include #include @@ -2678,3 +2680,5 @@ zfs_zaccess_rename(znode_t *sdzp, znode_t *szp, znode_t *tdzp, return (error); } + +#endif /* HAVE_ZPL */ From 6bed331e5960c9569f02dbeb5b0d3aca78f0c73f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 22 Dec 2008 13:47:58 -0800 Subject: [PATCH 2/3] More compat changes --- lib/libzpool/include/sys/zfs_context.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libzpool/include/sys/zfs_context.h b/lib/libzpool/include/sys/zfs_context.h index ef22772ce8..d9be1eb293 100644 --- a/lib/libzpool/include/sys/zfs_context.h +++ b/lib/libzpool/include/sys/zfs_context.h @@ -190,9 +190,9 @@ _NOTE(CONSTCOND) } while (0) /* * Threads */ - -/* XXX: not portable */ -#define curthread ((void *)(uintptr_t)pthread_self()) +#define curthread ((void *)(uintptr_t)pthread_self()) +#define tsd_get(key) pthread_getspecific(key) +#define tsd_set(key, val) pthread_setspecific(key, val) typedef struct kthread kthread_t; typedef void (*thread_func_t)(void *); From d684390d3ad34d90c59cc70b61d4b66620bc93c1 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 22 Dec 2008 13:49:15 -0800 Subject: [PATCH 3/3] Just fix a bogus return type --- module/zfs/rrwlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/rrwlock.c b/module/zfs/rrwlock.c index 710685dbc7..db3b70fc68 100644 --- a/module/zfs/rrwlock.c +++ b/module/zfs/rrwlock.c @@ -118,7 +118,7 @@ rrn_find_and_remove(rrwlock_t *rrl) rrw_node_t *prev = NULL; if (refcount_count(&rrl->rr_linked_rcount) == 0) - return (NULL); + return (B_FALSE); for (rn = tsd_get(rrw_tsd_key); rn != NULL; rn = rn->rn_next) { if (rn->rn_rrl == rrl) {