+void ldlm_dump_all_namespaces(void)
+{
+ struct list_head *tmp;
+
+ spin_lock(&ldlm_namespace_lock);
+
+ list_for_each(tmp, &ldlm_namespace_list) {
+ struct ldlm_namespace *ns;
+ ns = list_entry(tmp, struct ldlm_namespace, ns_list_chain);
+ ldlm_namespace_dump(ns);
+ }
+
+ spin_unlock(&ldlm_namespace_lock);
+}
+
+void ldlm_namespace_dump(struct ldlm_namespace *ns)
+{
+ struct list_head *tmp;
+
+ l_lock(&ns->ns_lock);
+ CDEBUG(D_OTHER, "--- Namespace: %s (rc: %d, client: %d)\n", ns->ns_name,
+ ns->ns_refcount, ns->ns_client);
+
+ list_for_each(tmp, &ns->ns_root_list) {
+ struct ldlm_resource *res;
+ res = list_entry(tmp, struct ldlm_resource, lr_childof);
+
+ /* Once we have resources with children, this should really dump
+ * them recursively. */
+ ldlm_resource_dump(res);
+ }
+ l_unlock(&ns->ns_lock);
+}
+