Whamcloud - gitweb
land 0.5.20.3 b_devel onto HEAD (b_devel will remain)
[fs/lustre-release.git] / lustre / ldlm / l_lock.c
index 680d4f0..c439eed 100644 (file)
@@ -20,6 +20,8 @@
  *
  */
 
+#define DEBUG_SUBSYSTEM S_LDLM
+#ifdef __KERNEL__
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
+#else 
+#include <liblustre.h>
+#endif
 
-#define DEBUG_SUBSYSTEM S_LDLM
-
+#include <linux/lustre_dlm.h>
 #include <linux/obd_class.h>
 #include <linux/lustre_lib.h>
 
@@ -65,6 +69,10 @@ void l_lock(struct lustre_lock *lock)
                 owner = 1;
         spin_unlock(&lock->l_spin);
 
+        /* This is safe to increment outside the spinlock because we
+         * can only have 1 CPU running on the current task
+         * (i.e. l_owner == current), regardless of the number of CPUs.
+         */
         if (owner) {
                 ++lock->l_depth;
         } else {