From 0e77fc118e2c105af0df5d1c7aa6627ed601bfa1 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 29 Sep 2009 03:19:09 -0700 Subject: [PATCH] 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. --- include/sys/rwlock.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/sys/rwlock.h b/include/sys/rwlock.h index a68d072..75356b9 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); \ }) -- 2.39.2