51 testfn(ls) || dlm_recovery_stopped(ls),
57 if (dlm_recovery_stopped(ls)) {
58 log_debug(ls,
"dlm_wait_function aborted");
89 _set_recover_status(ls, status);
93 static int wait_status_all(
struct dlm_ls *ls,
uint32_t wait_status,
103 if (dlm_recovery_stopped(ls)) {
126 static int wait_status_low(
struct dlm_ls *ls,
uint32_t wait_status,
133 if (dlm_recovery_stopped(ls)) {
158 error = wait_status_all(ls, status, 0);
162 error = wait_status_low(ls, status_all, 0);
237 static int recover_list_empty(
struct dlm_ls *ls)
248 static void recover_list_add(
struct dlm_rsb *
r)
261 static void recover_list_del(
struct dlm_rsb *r)
273 static void recover_list_clear(
struct dlm_ls *ls)
286 log_error(ls,
"warning: recover_list_count %d",
293 static int recover_idr_empty(
struct dlm_ls *ls)
305 static int recover_idr_add(
struct dlm_rsb *r)
331 static void recover_idr_del(
struct dlm_rsb *r)
354 static int recover_idr_clear_rsb(
int id,
void *
p,
void *
data)
367 static void recover_idr_clear(
struct dlm_ls *ls)
374 log_error(ls,
"warning: recover_list_count %d",
415 static void set_master_lkbs(
struct dlm_rsb *r)
429 static void set_new_master(
struct dlm_rsb *r)
446 static int recover_master(
struct dlm_rsb *r,
unsigned int *
count)
449 int our_nodeid, dir_nodeid;
464 if (dir_nodeid == our_nodeid) {
499 static int recover_master_static(
struct dlm_rsb *r,
unsigned int *count)
502 int new_master = dir_nodeid;
528 unsigned int total = 0;
529 unsigned int count = 0;
530 int nodir = dlm_no_directory(ls);
537 if (dlm_recovery_stopped(ls)) {
545 error = recover_master_static(r, &count);
547 error = recover_master(r, &count);
559 log_debug(ls,
"dlm_recover_masters %u of %u", count, total);
564 recover_idr_clear(ls);
571 int ret_nodeid, new_master;
573 r = recover_idr_find(ls, rc->
rc_id);
575 log_error(ls,
"dlm_recover_master_reply no id %llx",
576 (
unsigned long long)rc->
rc_id);
585 new_master = ret_nodeid;
594 if (recover_idr_empty(ls))
634 static int recover_locks(
struct dlm_rsb *r)
664 int error, count = 0;
676 if (dlm_recovery_stopped(ls)) {
682 error = recover_locks(r);
692 log_debug(ls,
"dlm_recover_locks %d out", count);
697 recover_list_clear(ls);
711 if (recover_list_empty(r->
res_ls))
729 static void recover_lvb(
struct dlm_rsb *r)
733 int lock_lvb_exists = 0;
734 int big_lock_exists = 0;
735 int lvblen = r->
res_ls->ls_lvblen;
748 if (((
int)lkb->
lkb_lvbseq - (
int)high_seq) >= 0) {
765 if (((
int)lkb->
lkb_lvbseq - (
int)high_seq) >= 0) {
772 if (!lock_lvb_exists)
775 if (!big_lock_exists)
788 if (big_lock_exists) {
791 }
else if (high_lkb) {
805 static void recover_conversion(
struct dlm_rsb *r)
823 log_debug(ls,
"recover_conversion %x set gr to rq %d",
827 log_debug(ls,
"recover_conversion %x set gr %d",
838 static void recover_grant(
struct dlm_rsb *r)
847 unsigned int count = 0;
854 recover_conversion(r);
867 log_debug(ls,
"dlm_recover_rsbs %d done", count);
894 log_error(ls,
"dlm_create_root_list toss not empty");
918 unsigned int count = 0;
934 log_debug(ls,
"dlm_clear_toss %u done", count);