summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-09-29 03:19:09 -0700
committerBrian Behlendorf <[email protected]>2009-09-29 03:19:09 -0700
commit0e77fc118e2c105af0df5d1c7aa6627ed601bfa1 (patch)
treedbc0dd2b32827a6944bb53c6cccf26a54e441e90
parent4d54fdee1d774ddaef381893434a3721067e2c56 (diff)
Expand SEM() outside init_rwsem and directly call __init_rwsem().
We need to directly call __init_rwsem() or the name gets expanded to SEM(lock-name). This is safe and correct for the support arches x86/x86_64/ppc/ppc64.
-rw-r--r--include/sys/rwlock.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/sys/rwlock.h b/include/sys/rwlock.h
index a68d07243..75356b95d 100644
--- a/include/sys/rwlock.h
+++ b/include/sys/rwlock.h
@@ -154,7 +154,9 @@ RW_LOCK_HELD(krwlock_t *rwp)
*/
#define rw_init(rwp, name, type, arg) \
({ \
- init_rwsem(SEM(rwp)); \
+ static struct lock_class_key __key; \
+ \
+ __init_rwsem(SEM(rwp), #rwp, &__key); \
spl_rw_clear_owner(rwp); \
})