]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/dlm/dlmdebug.c
[PATCH] ocfs2: use __set_current_state()
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / dlm / dlmdebug.c
index c7eae5d3324ea833192f74aefc2a69e5dd5db72a..64239b37e5d4bcd9a48c902469f8a85881f38568 100644 (file)
 
 #include "dlmapi.h"
 #include "dlmcommon.h"
-#include "dlmdebug.h"
 
 #include "dlmdomain.h"
-#include "dlmdebug.h"
 
 #define MLOG_MASK_PREFIX ML_DLM
 #include "cluster/masklog.h"
@@ -55,6 +53,23 @@ void dlm_print_one_lock_resource(struct dlm_lock_resource *res)
        spin_unlock(&res->spinlock);
 }
 
+static void dlm_print_lockres_refmap(struct dlm_lock_resource *res)
+{
+       int bit;
+       assert_spin_locked(&res->spinlock);
+
+       mlog(ML_NOTICE, "  refmap nodes: [ ");
+       bit = 0;
+       while (1) {
+               bit = find_next_bit(res->refmap, O2NM_MAX_NODES, bit);
+               if (bit >= O2NM_MAX_NODES)
+                       break;
+               printk("%u ", bit);
+               bit++;
+       }
+       printk("], inflight=%u\n", res->inflight_locks);
+}
+
 void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
 {
        struct list_head *iter2;
@@ -67,6 +82,7 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
               res->owner, res->state);
        mlog(ML_NOTICE, "  last used: %lu, on purge list: %s\n",
             res->last_used, list_empty(&res->purge) ? "no" : "yes");
+       dlm_print_lockres_refmap(res);
        mlog(ML_NOTICE, "  granted queue: \n");
        list_for_each(iter2, &res->granted) {
                lock = list_entry(iter2, struct dlm_lock, list);
@@ -74,8 +90,8 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
                mlog(ML_NOTICE, "    type=%d, conv=%d, node=%u, "
                       "cookie=%u:%llu, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", 
                       lock->ml.type, lock->ml.convert_type, lock->ml.node, 
-                      dlm_get_lock_cookie_node(lock->ml.cookie), 
-                      dlm_get_lock_cookie_seq(lock->ml.cookie), 
+                    dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
+                    dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)),
                       list_empty(&lock->ast_list) ? 'y' : 'n',
                       lock->ast_pending ? 'y' : 'n',
                       list_empty(&lock->bast_list) ? 'y' : 'n',
@@ -89,8 +105,8 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
                mlog(ML_NOTICE, "    type=%d, conv=%d, node=%u, "
                       "cookie=%u:%llu, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", 
                       lock->ml.type, lock->ml.convert_type, lock->ml.node, 
-                      dlm_get_lock_cookie_node(lock->ml.cookie), 
-                      dlm_get_lock_cookie_seq(lock->ml.cookie), 
+                    dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
+                    dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)),
                       list_empty(&lock->ast_list) ? 'y' : 'n',
                       lock->ast_pending ? 'y' : 'n',
                       list_empty(&lock->bast_list) ? 'y' : 'n',
@@ -104,8 +120,8 @@ void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
                mlog(ML_NOTICE, "    type=%d, conv=%d, node=%u, "
                       "cookie=%u:%llu, ast=(empty=%c,pend=%c), bast=(empty=%c,pend=%c)\n", 
                       lock->ml.type, lock->ml.convert_type, lock->ml.node, 
-                      dlm_get_lock_cookie_node(lock->ml.cookie), 
-                      dlm_get_lock_cookie_seq(lock->ml.cookie), 
+                    dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
+                    dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)),
                       list_empty(&lock->ast_list) ? 'y' : 'n',
                       lock->ast_pending ? 'y' : 'n',
                       list_empty(&lock->bast_list) ? 'y' : 'n',
@@ -120,6 +136,7 @@ void dlm_print_one_lock(struct dlm_lock *lockid)
 }
 EXPORT_SYMBOL_GPL(dlm_print_one_lock);
 
+#if 0
 void dlm_dump_lock_resources(struct dlm_ctxt *dlm)
 {
        struct dlm_lock_resource *res;
@@ -136,12 +153,13 @@ void dlm_dump_lock_resources(struct dlm_ctxt *dlm)
 
        spin_lock(&dlm->spinlock);
        for (i=0; i<DLM_HASH_BUCKETS; i++) {
-               bucket = &(dlm->lockres_hash[i]);
+               bucket = dlm_lockres_hash(dlm, i);
                hlist_for_each_entry(res, iter, bucket, hash_node)
                        dlm_print_one_lock_resource(res);
        }
        spin_unlock(&dlm->spinlock);
 }
+#endif  /*  0  */
 
 static const char *dlm_errnames[] = {
        [DLM_NORMAL] =                  "DLM_NORMAL",