Lines Matching refs: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 if (dlm_recovery_stopped(ls)) { in dlm_recover_directory()
92 error = dlm_rcom_names(ls, memb->nodeid, in dlm_recover_directory()
103 b = ls->ls_recover_buf->rc_buf; in dlm_recover_directory()
104 left = le16_to_cpu(ls->ls_recover_buf->rc_header.h_length); in dlm_recover_directory()
134 error = dlm_master_lookup(ls, memb->nodeid, in dlm_recover_directory()
139 log_error(ls, "recover_dir lookup %d", in dlm_recover_directory()
152 log_error(ls, "recover_dir lookup %d " in dlm_recover_directory()
189 dlm_set_recover_status(ls, DLM_RS_DIR); in dlm_recover_directory()
191 log_rinfo(ls, "dlm_recover_directory %u in %u new", in dlm_recover_directory()
199 static struct dlm_rsb *find_rsb_root(struct dlm_ls *ls, char *name, int len) in find_rsb_root() argument
206 bucket = hash & (ls->ls_rsbtbl_size - 1); in find_rsb_root()
208 spin_lock(&ls->ls_rsbtbl[bucket].lock); in find_rsb_root()
209 rv = dlm_search_rsb_tree(&ls->ls_rsbtbl[bucket].keep, name, len, &r); in find_rsb_root()
211 rv = dlm_search_rsb_tree(&ls->ls_rsbtbl[bucket].toss, in find_rsb_root()
213 spin_unlock(&ls->ls_rsbtbl[bucket].lock); in find_rsb_root()
218 down_read(&ls->ls_root_sem); in find_rsb_root()
219 list_for_each_entry(r, &ls->ls_root_list, res_root_list) { in find_rsb_root()
221 up_read(&ls->ls_root_sem); in find_rsb_root()
222 log_debug(ls, "find_rsb_root revert to root_list %s", in find_rsb_root()
227 up_read(&ls->ls_root_sem); in find_rsb_root()
235 void dlm_copy_master_names(struct dlm_ls *ls, char *inbuf, int inlen, in dlm_copy_master_names() argument
243 down_read(&ls->ls_root_sem); in dlm_copy_master_names()
246 r = find_rsb_root(ls, inbuf, inlen); in dlm_copy_master_names()
249 log_error(ls, "copy_master_names from %d start %d %s", in dlm_copy_master_names()
255 list = ls->ls_root_list.next; in dlm_copy_master_names()
258 for (offset = 0; list != &ls->ls_root_list; list = list->next) { in dlm_copy_master_names()
280 ls->ls_recover_dir_sent_msg++; in dlm_copy_master_names()
289 ls->ls_recover_dir_sent_res++; in dlm_copy_master_names()
297 if ((list == &ls->ls_root_list) && in dlm_copy_master_names()
302 ls->ls_recover_dir_sent_msg++; in dlm_copy_master_names()
305 up_read(&ls->ls_root_sem); in dlm_copy_master_names()