ocfs2/dlm: Tweak mle_state output
authorSunil Mushran <sunil.mushran@oracle.com>
Thu, 26 Feb 2009 23:00:49 +0000 (15:00 -0800)
committerMark Fasheh <mfasheh@suse.com>
Fri, 3 Apr 2009 18:39:25 +0000 (11:39 -0700)
The debugfs file, mle_state, now prints the number of largest number of mles
in one hash link.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/ocfs2/dlm/dlmdebug.c

index bdf1c7817bb5ad5a75c491e091f1de6e518b32bf..df52f706f66971026b2f09ae0f978a8ba17858f7 100644 (file)
@@ -494,7 +494,7 @@ static int debug_mle_print(struct dlm_ctxt *dlm, struct debug_buffer *db)
        struct hlist_head *bucket;
        struct hlist_node *list;
        int i, out = 0;
-       unsigned long total = 0;
+       unsigned long total = 0, longest = 0, bktcnt;
 
        out += snprintf(db->buf + out, db->len - out,
                        "Dumping MLEs for Domain: %s\n", dlm->name);
@@ -506,15 +506,18 @@ static int debug_mle_print(struct dlm_ctxt *dlm, struct debug_buffer *db)
                        mle = hlist_entry(list, struct dlm_master_list_entry,
                                          master_hash_node);
                        ++total;
+                       ++bktcnt;
                        if (db->len - out < 200)
                                continue;
                        out += dump_mle(mle, db->buf + out, db->len - out);
                }
+               longest = max(longest, bktcnt);
+               bktcnt = 0;
        }
        spin_unlock(&dlm->master_lock);
 
        out += snprintf(db->buf + out, db->len - out,
-                       "Total on list: %ld\n", total);
+                       "Total: %ld, Longest: %ld\n", total, longest);
        return out;
 }