Lines Matching full:ls
33 int dlm_hash2nodeid(struct dlm_ls *ls, uint32_t hash) in dlm_hash2nodeid() argument
37 if (ls->ls_num_nodes == 1) in dlm_hash2nodeid()
40 node = (hash >> 16) % ls->ls_total_weight; in dlm_hash2nodeid()
41 return ls->ls_node_array[node]; in dlm_hash2nodeid()
50 void dlm_recover_dir_nodeid(struct dlm_ls *ls) in dlm_recover_dir_nodeid() argument
54 down_read(&ls->ls_root_sem); in dlm_recover_dir_nodeid()
55 list_for_each_entry(r, &ls->ls_root_list, res_root_list) { in dlm_recover_dir_nodeid()
56 r->res_dir_nodeid = dlm_hash2nodeid(ls, r->res_hash); in dlm_recover_dir_nodeid()
58 up_read(&ls->ls_root_sem); in dlm_recover_dir_nodeid()
61 int dlm_recover_directory(struct dlm_ls *ls) in dlm_recover_directory() argument
69 log_rinfo(ls, "dlm_recover_directory"); in dlm_recover_directory()
71 if (dlm_no_directory(ls)) in dlm_recover_directory()
78 list_for_each_entry(memb, &ls->ls_nodes, list) { in dlm_recover_directory()
87 error = dlm_recovery_stopped(ls); in dlm_recover_directory()
91 error = dlm_rcom_names(ls, memb->nodeid, in dlm_recover_directory()
102 b = ls->ls_recover_buf->rc_buf; in dlm_recover_directory()
103 left = ls->ls_recover_buf->rc_header.h_length; in dlm_recover_directory()
133 error = dlm_master_lookup(ls, memb->nodeid, in dlm_recover_directory()
138 log_error(ls, "recover_dir lookup %d", in dlm_recover_directory()
151 log_error(ls, "recover_dir lookup %d " in dlm_recover_directory()
188 dlm_set_recover_status(ls, DLM_RS_DIR); in dlm_recover_directory()
190 log_rinfo(ls, "dlm_recover_directory %u in %u new", in dlm_recover_directory()
198 static struct dlm_rsb *find_rsb_root(struct dlm_ls *ls, char *name, int len) in find_rsb_root() argument
205 bucket = hash & (ls->ls_rsbtbl_size - 1); in find_rsb_root()
207 spin_lock(&ls->ls_rsbtbl[bucket].lock); in find_rsb_root()
208 rv = dlm_search_rsb_tree(&ls->ls_rsbtbl[bucket].keep, name, len, &r); in find_rsb_root()
210 rv = dlm_search_rsb_tree(&ls->ls_rsbtbl[bucket].toss, in find_rsb_root()
212 spin_unlock(&ls->ls_rsbtbl[bucket].lock); in find_rsb_root()
217 down_read(&ls->ls_root_sem); in find_rsb_root()
218 list_for_each_entry(r, &ls->ls_root_list, res_root_list) { in find_rsb_root()
220 up_read(&ls->ls_root_sem); in find_rsb_root()
221 log_debug(ls, "find_rsb_root revert to root_list %s", in find_rsb_root()
226 up_read(&ls->ls_root_sem); in find_rsb_root()
234 void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen, in dlm_copy_master_names() argument
242 down_read(&ls->ls_root_sem); in dlm_copy_master_names()
245 r = find_rsb_root(ls, inbuf, inlen); in dlm_copy_master_names()
248 log_error(ls, "copy_master_names from %d start %d %s", in dlm_copy_master_names()
254 list = ls->ls_root_list.next; in dlm_copy_master_names()
257 for (offset = 0; list != &ls->ls_root_list; list = list->next) { in dlm_copy_master_names()
279 ls->ls_recover_dir_sent_msg++; in dlm_copy_master_names()
288 ls->ls_recover_dir_sent_res++; in dlm_copy_master_names()
296 if ((list == &ls->ls_root_list) && in dlm_copy_master_names()
301 ls->ls_recover_dir_sent_msg++; in dlm_copy_master_names()
304 up_read(&ls->ls_root_sem); in dlm_copy_master_names()