Whamcloud - gitweb
Add an l_check_ns_lock to go with l_check_no_ns_lock.
authorphil <phil>
Sat, 12 Feb 2005 21:03:22 +0000 (21:03 +0000)
committerphil <phil>
Sat, 12 Feb 2005 21:03:22 +0000 (21:03 +0000)
lustre/ldlm/l_lock.c
lustre/ldlm/ldlm_internal.h

index af6a15b..baf43ab 100644 (file)
@@ -117,6 +117,18 @@ int l_has_lock(struct lustre_lock *lock)
 
 #ifdef __KERNEL__
 #include <linux/lustre_version.h>
+void l_check_ns_lock(struct ldlm_namespace *ns)
+{
+        static unsigned long next_msg;
+
+        if (!l_has_lock(&ns->ns_lock) && time_after(jiffies, next_msg)) {
+                CERROR("namespace %s lock not held when it should be; tell "
+                       "phil\n", ns->ns_name);
+                portals_debug_dumpstack(NULL);
+                next_msg = jiffies + 60 * HZ;
+        }
+}
+
 void l_check_no_ns_lock(struct ldlm_namespace *ns)
 {
         static unsigned long next_msg;
@@ -130,6 +142,14 @@ void l_check_no_ns_lock(struct ldlm_namespace *ns)
 }
 
 #else
+void l_check_ns_lock(struct ldlm_namespace *ns)
+{
+        if (l_has_lock(&ns->ns_lock)) {
+                CERROR("namespace %s lock not held when it should be; tell "
+                       "phil\n", ns->ns_name);
+        }
+}
+
 void l_check_no_ns_lock(struct ldlm_namespace *ns)
 {
         if (l_has_lock(&ns->ns_lock)) {
index c18884b..ccaafdc 100644 (file)
@@ -47,6 +47,7 @@ int ldlm_process_flock_lock(struct ldlm_lock *lock, int *flags, int first_enq,
                             ldlm_error_t *err);
 
 /* l_lock.c */
+void l_check_ns_lock(struct ldlm_namespace *ns);
 void l_check_no_ns_lock(struct ldlm_namespace *ns);
 
 extern struct proc_dir_entry *ldlm_svc_proc_dir;