]> git.proxmox.com Git - mirror_spl.git/commitdiff
Expand SEM() outside init_rwsem and directly call __init_rwsem().
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 29 Sep 2009 10:19:09 +0000 (03:19 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 29 Sep 2009 10:19:09 +0000 (03:19 -0700)
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

index a68d072433b4700693f81a974cd59df33e7f2a55..75356b95d8fb77bd91ee1d092c524b6c6069bae0 100644 (file)
@@ -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);                                        \
 })