Whamcloud - gitweb
LU-4801 ldlm: discard l_lock from struct ldlm_lock.
[fs/lustre-release.git] / lustre / include / lustre_dlm.h
index 63f9bd6..ea5efc9 100644 (file)
@@ -782,13 +782,10 @@ struct ldlm_lock {
         */
        struct portals_handle   l_handle;
        /**
-        * Internal spinlock protects l_resource.  We should hold this lock
-        * first before taking res_lock.
-        */
-       spinlock_t              l_lock;
-       /**
         * Pointer to actual resource this lock is in.
-        * ldlm_lock_change_resource() can change this.
+        * ldlm_lock_change_resource() can change this on the client.
+        * When this is possible, rcu must be used to stablise
+        * the resource while we lock and check it hasn't been changed.
         */
        struct ldlm_resource    *l_resource;
        /**
@@ -1060,9 +1057,13 @@ struct ldlm_resource {
 
        /**
         * List item for list in namespace hash.
-        * protected by ns_lock
+        * protected by ns_lock.
+        * Shared with linkage for RCU-delayed free.
         */
-       struct hlist_node       lr_hash;
+       union {
+               struct hlist_node       lr_hash;
+               struct rcu_head         lr_rcu;
+       };
 
        /** Reference count for this resource */
        atomic_t                lr_refcount;