]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/dlm/dlmdebug.c
ocfs2/dlm: dlm_set_lockres_owner() and dlm_change_lockres_owner() inlined
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / dlm / dlmdebug.c
index b32f60a5acfb9e4353ce3ad61d009bb6858d158f..d7decaa687e6f1a430c43a4f57debc1ea776ea2e 100644 (file)
@@ -288,15 +288,15 @@ static int dump_mle(struct dlm_master_list_entry *mle, char *buf, int len)
 {
        int out = 0;
        unsigned int namelen;
-       const char *name;
+       unsigned char *name;
        char *mle_type;
 
        if (mle->type != DLM_MLE_MASTER) {
-               namelen = mle->u.name.len;
-               name = mle->u.name.name;
+               name = mle->u.mlename.name;
+               namelen = mle->u.mlename.len;
        } else {
-               namelen = mle->u.res->lockname.len;
-               name = mle->u.res->lockname.name;
+               name  = (unsigned char *)mle->u.mleres->lockname.name;
+               namelen = mle->u.mleres->lockname.len;
        }
 
        if (mle->type == DLM_MLE_BLOCK)
@@ -501,18 +501,25 @@ static struct file_operations debug_purgelist_fops = {
 static int debug_mle_print(struct dlm_ctxt *dlm, struct debug_buffer *db)
 {
        struct dlm_master_list_entry *mle;
-       int out = 0;
+       struct hlist_head *bucket;
+       struct hlist_node *list;
+       int i, out = 0;
        unsigned long total = 0;
 
        out += snprintf(db->buf + out, db->len - out,
                        "Dumping MLEs for Domain: %s\n", dlm->name);
 
        spin_lock(&dlm->master_lock);
-       list_for_each_entry(mle, &dlm->master_list, list) {
-               ++total;
-               if (db->len - out < 200)
-                       continue;
-               out += dump_mle(mle, db->buf + out, db->len - out);
+       for (i = 0; i < DLM_HASH_BUCKETS; i++) {
+               bucket = dlm_master_hash(dlm, i);
+               hlist_for_each(list, bucket) {
+                       mle = hlist_entry(list, struct dlm_master_list_entry,
+                                         master_hash_node);
+                       ++total;
+                       if (db->len - out < 200)
+                               continue;
+                       out += dump_mle(mle, db->buf + out, db->len - out);
+               }
        }
        spin_unlock(&dlm->master_lock);
 
@@ -756,12 +763,6 @@ static int debug_state_print(struct dlm_ctxt *dlm, struct debug_buffer *db)
        int out = 0;
        struct dlm_reco_node_data *node;
        char *state;
-       int lres, rres, ures, tres;
-
-       lres = atomic_read(&dlm->local_resources);
-       rres = atomic_read(&dlm->remote_resources);
-       ures = atomic_read(&dlm->unknown_resources);
-       tres = lres + rres + ures;
 
        spin_lock(&dlm->spinlock);
 
@@ -804,21 +805,14 @@ static int debug_state_print(struct dlm_ctxt *dlm, struct debug_buffer *db)
                                 db->buf + out, db->len - out);
        out += snprintf(db->buf + out, db->len - out, "\n");
 
-       /* Mastered Resources Total: xxx  Locally: xxx  Remotely: ... */
-       out += snprintf(db->buf + out, db->len - out,
-                       "Mastered Resources Total: %d  Locally: %d  "
-                       "Remotely: %d  Unknown: %d\n",
-                       tres, lres, rres, ures);
-
        /* Lists: Dirty=Empty  Purge=InUse  PendingASTs=Empty  ... */
        out += snprintf(db->buf + out, db->len - out,
                        "Lists: Dirty=%s  Purge=%s  PendingASTs=%s  "
-                       "PendingBASTs=%s  Master=%s\n",
+                       "PendingBASTs=%s\n",
                        (list_empty(&dlm->dirty_list) ? "Empty" : "InUse"),
                        (list_empty(&dlm->purge_list) ? "Empty" : "InUse"),
                        (list_empty(&dlm->pending_asts) ? "Empty" : "InUse"),
-                       (list_empty(&dlm->pending_basts) ? "Empty" : "InUse"),
-                       (list_empty(&dlm->master_list) ? "Empty" : "InUse"));
+                       (list_empty(&dlm->pending_basts) ? "Empty" : "InUse"));
 
        /* Purge Count: xxx  Refs: xxx */
        out += snprintf(db->buf + out, db->len - out,