diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2008-03-10 18:16:28 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-04-18 11:56:09 -0400 |
commit | e5a0334cbd65e27f8dfd9985aa805874fe59e879 (patch) | |
tree | adc51fd08d763c93cbe737e6bb3107b46df4c391 /fs/ocfs2/dlm/dlmmaster.c | |
parent | 7209300a9b987e017cae2ef9d7ef55b0fdd71869 (diff) |
ocfs2/dlm: Move dlm_print_one_mle() from dlmmaster.c to dlmdebug.c
This patch helps in consolidating debugging related functions in dlmdebug.c.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/dlm/dlmmaster.c')
-rw-r--r-- | fs/ocfs2/dlm/dlmmaster.c | 89 |
1 files changed, 1 insertions, 88 deletions
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 94cadcb0cba2..efc015c6128a 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include "dlmapi.h" | 48 | #include "dlmapi.h" |
49 | #include "dlmcommon.h" | 49 | #include "dlmcommon.h" |
50 | #include "dlmdomain.h" | 50 | #include "dlmdomain.h" |
51 | #include "dlmdebug.h" | ||
51 | 52 | ||
52 | #define MLOG_MASK_PREFIX (ML_DLM|ML_DLM_MASTER) | 53 | #define MLOG_MASK_PREFIX (ML_DLM|ML_DLM_MASTER) |
53 | #include "cluster/masklog.h" | 54 | #include "cluster/masklog.h" |
@@ -91,94 +92,6 @@ static inline int dlm_mle_equal(struct dlm_ctxt *dlm, | |||
91 | return 1; | 92 | return 1; |
92 | } | 93 | } |
93 | 94 | ||
94 | #define dlm_print_nodemap(m) _dlm_print_nodemap(m,#m) | ||
95 | static void _dlm_print_nodemap(unsigned long *map, const char *mapname) | ||
96 | { | ||
97 | int i; | ||
98 | printk("%s=[ ", mapname); | ||
99 | for (i=0; i<O2NM_MAX_NODES; i++) | ||
100 | if (test_bit(i, map)) | ||
101 | printk("%d ", i); | ||
102 | printk("]"); | ||
103 | } | ||
104 | |||
105 | static void dlm_print_one_mle(struct dlm_master_list_entry *mle) | ||
106 | { | ||
107 | int refs; | ||
108 | char *type; | ||
109 | char attached; | ||
110 | u8 master; | ||
111 | unsigned int namelen; | ||
112 | const char *name; | ||
113 | struct kref *k; | ||
114 | unsigned long *maybe = mle->maybe_map, | ||
115 | *vote = mle->vote_map, | ||
116 | *resp = mle->response_map, | ||
117 | *node = mle->node_map; | ||
118 | |||
119 | k = &mle->mle_refs; | ||
120 | if (mle->type == DLM_MLE_BLOCK) | ||
121 | type = "BLK"; | ||
122 | else if (mle->type == DLM_MLE_MASTER) | ||
123 | type = "MAS"; | ||
124 | else | ||
125 | type = "MIG"; | ||
126 | refs = atomic_read(&k->refcount); | ||
127 | master = mle->master; | ||
128 | attached = (list_empty(&mle->hb_events) ? 'N' : 'Y'); | ||
129 | |||
130 | if (mle->type != DLM_MLE_MASTER) { | ||
131 | namelen = mle->u.name.len; | ||
132 | name = mle->u.name.name; | ||
133 | } else { | ||
134 | namelen = mle->u.res->lockname.len; | ||
135 | name = mle->u.res->lockname.name; | ||
136 | } | ||
137 | |||
138 | mlog(ML_NOTICE, "%.*s: %3s refs=%3d mas=%3u new=%3u evt=%c inuse=%d ", | ||
139 | namelen, name, type, refs, master, mle->new_master, attached, | ||
140 | mle->inuse); | ||
141 | dlm_print_nodemap(maybe); | ||
142 | printk(", "); | ||
143 | dlm_print_nodemap(vote); | ||
144 | printk(", "); | ||
145 | dlm_print_nodemap(resp); | ||
146 | printk(", "); | ||
147 | dlm_print_nodemap(node); | ||
148 | printk(", "); | ||
149 | printk("\n"); | ||
150 | } | ||
151 | |||
152 | #if 0 | ||
153 | /* Code here is included but defined out as it aids debugging */ | ||
154 | |||
155 | static void dlm_dump_mles(struct dlm_ctxt *dlm) | ||
156 | { | ||
157 | struct dlm_master_list_entry *mle; | ||
158 | |||
159 | mlog(ML_NOTICE, "dumping all mles for domain %s:\n", dlm->name); | ||
160 | spin_lock(&dlm->master_lock); | ||
161 | list_for_each_entry(mle, &dlm->master_list, list) | ||
162 | dlm_print_one_mle(mle); | ||
163 | spin_unlock(&dlm->master_lock); | ||
164 | } | ||
165 | |||
166 | int dlm_dump_all_mles(const char __user *data, unsigned int len) | ||
167 | { | ||
168 | struct dlm_ctxt *dlm; | ||
169 | |||
170 | spin_lock(&dlm_domain_lock); | ||
171 | list_for_each_entry(dlm, &dlm_domains, list) { | ||
172 | mlog(ML_NOTICE, "found dlm: %p, name=%s\n", dlm, dlm->name); | ||
173 | dlm_dump_mles(dlm); | ||
174 | } | ||
175 | spin_unlock(&dlm_domain_lock); | ||
176 | return len; | ||
177 | } | ||
178 | EXPORT_SYMBOL_GPL(dlm_dump_all_mles); | ||
179 | |||
180 | #endif /* 0 */ | ||
181 | |||
182 | static struct kmem_cache *dlm_lockres_cache = NULL; | 95 | static struct kmem_cache *dlm_lockres_cache = NULL; |
183 | static struct kmem_cache *dlm_lockname_cache = NULL; | 96 | static struct kmem_cache *dlm_lockname_cache = NULL; |
184 | static struct kmem_cache *dlm_mle_cache = NULL; | 97 | static struct kmem_cache *dlm_mle_cache = NULL; |