Lines Matching refs:rc
33 struct dlm_rcom *rc; in create_rcom() local
46 rc = (struct dlm_rcom *) mb; in create_rcom()
48 rc->rc_header.h_version = (DLM_HEADER_MAJOR | DLM_HEADER_MINOR); in create_rcom()
49 rc->rc_header.h_lockspace = ls->ls_global_id; in create_rcom()
50 rc->rc_header.h_nodeid = dlm_our_nodeid(); in create_rcom()
51 rc->rc_header.h_length = mb_len; in create_rcom()
52 rc->rc_header.h_cmd = DLM_RCOM; in create_rcom()
54 rc->rc_type = type; in create_rcom()
57 rc->rc_seq = ls->ls_recover_seq; in create_rcom()
61 *rc_ret = rc; in create_rcom()
66 struct dlm_rcom *rc) in send_rcom() argument
68 dlm_rcom_out(rc); in send_rcom()
93 static int check_rcom_config(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid) in check_rcom_config() argument
95 struct rcom_config *rf = (struct rcom_config *) rc->rc_buf; in check_rcom_config()
97 if ((rc->rc_header.h_version & 0xFFFF0000) != DLM_HEADER_MAJOR) { in check_rcom_config()
100 rc->rc_header.h_version); in check_rcom_config()
144 struct dlm_rcom *rc; in dlm_rcom_status() local
151 rc = ls->ls_recover_buf; in dlm_rcom_status()
152 rc->rc_result = dlm_recover_status(ls); in dlm_rcom_status()
158 sizeof(struct rcom_status), &rc, &mh); in dlm_rcom_status()
162 set_rcom_status(ls, (struct rcom_status *)rc->rc_buf, status_flags); in dlm_rcom_status()
164 allow_sync_reply(ls, &rc->rc_id); in dlm_rcom_status()
167 send_rcom(ls, mh, rc); in dlm_rcom_status()
176 rc = ls->ls_recover_buf; in dlm_rcom_status()
178 if (rc->rc_result == -ESRCH) { in dlm_rcom_status()
181 rc->rc_result = 0; in dlm_rcom_status()
184 error = check_rcom_config(ls, rc, nodeid); in dlm_rcom_status()
194 struct dlm_rcom *rc; in receive_rcom_status() local
223 len, &rc, &mh); in receive_rcom_status()
227 rc->rc_id = rc_in->rc_id; in receive_rcom_status()
228 rc->rc_seq_reply = rc_in->rc_seq; in receive_rcom_status()
229 rc->rc_result = status; in receive_rcom_status()
231 set_rcom_config(ls, (struct rcom_config *)rc->rc_buf, num_slots); in receive_rcom_status()
241 rc->rc_result = 0; in receive_rcom_status()
242 set_rcom_config(ls, (struct rcom_config *)rc->rc_buf, 0); in receive_rcom_status()
246 dlm_slots_copy_out(ls, rc); in receive_rcom_status()
250 send_rcom(ls, mh, rc); in receive_rcom_status()
274 struct dlm_rcom *rc; in dlm_rcom_names() local
281 error = create_rcom(ls, nodeid, DLM_RCOM_NAMES, last_len, &rc, &mh); in dlm_rcom_names()
284 memcpy(rc->rc_buf, last_name, last_len); in dlm_rcom_names()
286 allow_sync_reply(ls, &rc->rc_id); in dlm_rcom_names()
289 send_rcom(ls, mh, rc); in dlm_rcom_names()
301 struct dlm_rcom *rc; in receive_rcom_names() local
309 error = create_rcom(ls, nodeid, DLM_RCOM_NAMES_REPLY, outlen, &rc, &mh); in receive_rcom_names()
312 rc->rc_id = rc_in->rc_id; in receive_rcom_names()
313 rc->rc_seq_reply = rc_in->rc_seq; in receive_rcom_names()
315 dlm_copy_master_names(ls, rc_in->rc_buf, inlen, rc->rc_buf, outlen, in receive_rcom_names()
317 send_rcom(ls, mh, rc); in receive_rcom_names()
322 struct dlm_rcom *rc; in dlm_send_rcom_lookup() local
328 &rc, &mh); in dlm_send_rcom_lookup()
331 memcpy(rc->rc_buf, r->res_name, r->res_length); in dlm_send_rcom_lookup()
332 rc->rc_id = (unsigned long) r->res_id; in dlm_send_rcom_lookup()
334 send_rcom(ls, mh, rc); in dlm_send_rcom_lookup()
341 struct dlm_rcom *rc; in receive_rcom_lookup() local
346 error = create_rcom(ls, nodeid, DLM_RCOM_LOOKUP_REPLY, 0, &rc, &mh); in receive_rcom_lookup()
361 rc->rc_result = ret_nodeid; in receive_rcom_lookup()
362 rc->rc_id = rc_in->rc_id; in receive_rcom_lookup()
363 rc->rc_seq_reply = rc_in->rc_seq; in receive_rcom_lookup()
365 send_rcom(ls, mh, rc); in receive_rcom_lookup()
406 struct dlm_rcom *rc; in dlm_send_rcom_lock() local
414 error = create_rcom(ls, r->res_nodeid, DLM_RCOM_LOCK, len, &rc, &mh); in dlm_send_rcom_lock()
418 rl = (struct rcom_lock *) rc->rc_buf; in dlm_send_rcom_lock()
420 rc->rc_id = (unsigned long) r; in dlm_send_rcom_lock()
422 send_rcom(ls, mh, rc); in dlm_send_rcom_lock()
430 struct dlm_rcom *rc; in receive_rcom_lock() local
437 sizeof(struct rcom_lock), &rc, &mh); in receive_rcom_lock()
444 memcpy(rc->rc_buf, rc_in->rc_buf, sizeof(struct rcom_lock)); in receive_rcom_lock()
445 rc->rc_id = rc_in->rc_id; in receive_rcom_lock()
446 rc->rc_seq_reply = rc_in->rc_seq; in receive_rcom_lock()
448 send_rcom(ls, mh, rc); in receive_rcom_lock()
456 struct dlm_rcom *rc; in dlm_send_ls_not_ready() local
467 rc = (struct dlm_rcom *) mb; in dlm_send_ls_not_ready()
469 rc->rc_header.h_version = (DLM_HEADER_MAJOR | DLM_HEADER_MINOR); in dlm_send_ls_not_ready()
470 rc->rc_header.h_lockspace = rc_in->rc_header.h_lockspace; in dlm_send_ls_not_ready()
471 rc->rc_header.h_nodeid = dlm_our_nodeid(); in dlm_send_ls_not_ready()
472 rc->rc_header.h_length = mb_len; in dlm_send_ls_not_ready()
473 rc->rc_header.h_cmd = DLM_RCOM; in dlm_send_ls_not_ready()
475 rc->rc_type = DLM_RCOM_STATUS_REPLY; in dlm_send_ls_not_ready()
476 rc->rc_id = rc_in->rc_id; in dlm_send_ls_not_ready()
477 rc->rc_seq_reply = rc_in->rc_seq; in dlm_send_ls_not_ready()
478 rc->rc_result = -ESRCH; in dlm_send_ls_not_ready()
480 rf = (struct rcom_config *) rc->rc_buf; in dlm_send_ls_not_ready()
483 dlm_rcom_out(rc); in dlm_send_ls_not_ready()
534 void dlm_receive_rcom(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid) in dlm_receive_rcom() argument
541 switch (rc->rc_type) { in dlm_receive_rcom()
574 if (stop && (rc->rc_type != DLM_RCOM_STATUS)) in dlm_receive_rcom()
577 if (reply && (rc->rc_seq_reply != seq)) in dlm_receive_rcom()
586 switch (rc->rc_type) { in dlm_receive_rcom()
588 receive_rcom_status(ls, rc); in dlm_receive_rcom()
592 receive_rcom_names(ls, rc); in dlm_receive_rcom()
596 receive_rcom_lookup(ls, rc); in dlm_receive_rcom()
600 if (rc->rc_header.h_length < lock_size) in dlm_receive_rcom()
602 receive_rcom_lock(ls, rc); in dlm_receive_rcom()
606 receive_sync_reply(ls, rc); in dlm_receive_rcom()
610 receive_sync_reply(ls, rc); in dlm_receive_rcom()
614 receive_rcom_lookup_reply(ls, rc); in dlm_receive_rcom()
618 if (rc->rc_header.h_length < lock_size) in dlm_receive_rcom()
620 dlm_recover_process_copy(ls, rc); in dlm_receive_rcom()
624 log_error(ls, "receive_rcom bad type %d", rc->rc_type); in dlm_receive_rcom()
631 rc->rc_type, in dlm_receive_rcom()
633 (unsigned long long)rc->rc_seq, in dlm_receive_rcom()
634 (unsigned long long)rc->rc_seq_reply, in dlm_receive_rcom()
640 rc->rc_type, nodeid); in dlm_receive_rcom()