diff options
author | David Teigland <teigland@redhat.com> | 2006-08-18 12:54:25 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-08-21 09:50:09 -0400 |
commit | a345da3e8f28ff69e1b14df78f7ddc6e7b78b726 (patch) | |
tree | a1aa40c1aae01064b64b953c9b4a16180dd82be9 /fs/dlm/lock.c | |
parent | 15d00c0b91ca776b51b5ab04f79ab35b06670d30 (diff) |
[DLM] dump rsb and locks on assert
Introduce new function dlm_dump_rsb() to call within assertions instead of
dlm_print_rsb(). The new function dumps info about all locks on the rsb
in addition to rsb details.
Signed-off-by: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/dlm/lock.c')
-rw-r--r-- | fs/dlm/lock.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index bb2e35151210..712438513cc4 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c | |||
@@ -171,6 +171,28 @@ void dlm_print_rsb(struct dlm_rsb *r) | |||
171 | r->res_recover_locks_count, r->res_name); | 171 | r->res_recover_locks_count, r->res_name); |
172 | } | 172 | } |
173 | 173 | ||
174 | void dlm_dump_rsb(struct dlm_rsb *r) | ||
175 | { | ||
176 | struct dlm_lkb *lkb; | ||
177 | |||
178 | dlm_print_rsb(r); | ||
179 | |||
180 | printk(KERN_ERR "rsb: root_list empty %d recover_list empty %d\n", | ||
181 | list_empty(&r->res_root_list), list_empty(&r->res_recover_list)); | ||
182 | printk(KERN_ERR "rsb lookup list\n"); | ||
183 | list_for_each_entry(lkb, &r->res_lookup, lkb_rsb_lookup) | ||
184 | dlm_print_lkb(lkb); | ||
185 | printk(KERN_ERR "rsb grant queue:\n"); | ||
186 | list_for_each_entry(lkb, &r->res_grantqueue, lkb_statequeue) | ||
187 | dlm_print_lkb(lkb); | ||
188 | printk(KERN_ERR "rsb convert queue:\n"); | ||
189 | list_for_each_entry(lkb, &r->res_convertqueue, lkb_statequeue) | ||
190 | dlm_print_lkb(lkb); | ||
191 | printk(KERN_ERR "rsb wait queue:\n"); | ||
192 | list_for_each_entry(lkb, &r->res_waitqueue, lkb_statequeue) | ||
193 | dlm_print_lkb(lkb); | ||
194 | } | ||
195 | |||
174 | /* Threads cannot use the lockspace while it's being recovered */ | 196 | /* Threads cannot use the lockspace while it's being recovered */ |
175 | 197 | ||
176 | static inline void lock_recovery(struct dlm_ls *ls) | 198 | static inline void lock_recovery(struct dlm_ls *ls) |
@@ -478,7 +500,7 @@ static void unhold_rsb(struct dlm_rsb *r) | |||
478 | { | 500 | { |
479 | int rv; | 501 | int rv; |
480 | rv = kref_put(&r->res_ref, toss_rsb); | 502 | rv = kref_put(&r->res_ref, toss_rsb); |
481 | DLM_ASSERT(!rv, dlm_print_rsb(r);); | 503 | DLM_ASSERT(!rv, dlm_dump_rsb(r);); |
482 | } | 504 | } |
483 | 505 | ||
484 | static void kill_rsb(struct kref *kref) | 506 | static void kill_rsb(struct kref *kref) |
@@ -488,12 +510,12 @@ static void kill_rsb(struct kref *kref) | |||
488 | /* All work is done after the return from kref_put() so we | 510 | /* All work is done after the return from kref_put() so we |
489 | can release the write_lock before the remove and free. */ | 511 | can release the write_lock before the remove and free. */ |
490 | 512 | ||
491 | DLM_ASSERT(list_empty(&r->res_lookup),); | 513 | DLM_ASSERT(list_empty(&r->res_lookup), dlm_dump_rsb(r);); |
492 | DLM_ASSERT(list_empty(&r->res_grantqueue),); | 514 | DLM_ASSERT(list_empty(&r->res_grantqueue), dlm_dump_rsb(r);); |
493 | DLM_ASSERT(list_empty(&r->res_convertqueue),); | 515 | DLM_ASSERT(list_empty(&r->res_convertqueue), dlm_dump_rsb(r);); |
494 | DLM_ASSERT(list_empty(&r->res_waitqueue),); | 516 | DLM_ASSERT(list_empty(&r->res_waitqueue), dlm_dump_rsb(r);); |
495 | DLM_ASSERT(list_empty(&r->res_root_list),); | 517 | DLM_ASSERT(list_empty(&r->res_root_list), dlm_dump_rsb(r);); |
496 | DLM_ASSERT(list_empty(&r->res_recover_list),); | 518 | DLM_ASSERT(list_empty(&r->res_recover_list), dlm_dump_rsb(r);); |
497 | } | 519 | } |
498 | 520 | ||
499 | /* Attaching/detaching lkb's from rsb's is for rsb reference counting. | 521 | /* Attaching/detaching lkb's from rsb's is for rsb reference counting. |
@@ -1336,7 +1358,7 @@ static void grant_pending_locks(struct dlm_rsb *r) | |||
1336 | struct dlm_lkb *lkb, *s; | 1358 | struct dlm_lkb *lkb, *s; |
1337 | int high = DLM_LOCK_IV; | 1359 | int high = DLM_LOCK_IV; |
1338 | 1360 | ||
1339 | DLM_ASSERT(is_master(r), dlm_print_rsb(r);); | 1361 | DLM_ASSERT(is_master(r), dlm_dump_rsb(r);); |
1340 | 1362 | ||
1341 | high = grant_pending_convert(r, high); | 1363 | high = grant_pending_convert(r, high); |
1342 | high = grant_pending_wait(r, high); | 1364 | high = grant_pending_wait(r, high); |
@@ -1431,7 +1453,7 @@ static int set_master(struct dlm_rsb *r, struct dlm_lkb *lkb) | |||
1431 | return 0; | 1453 | return 0; |
1432 | } | 1454 | } |
1433 | 1455 | ||
1434 | DLM_ASSERT(r->res_nodeid == -1, dlm_print_rsb(r);); | 1456 | DLM_ASSERT(r->res_nodeid == -1, dlm_dump_rsb(r);); |
1435 | 1457 | ||
1436 | dir_nodeid = dlm_dir_nodeid(r); | 1458 | dir_nodeid = dlm_dir_nodeid(r); |
1437 | 1459 | ||