Lines Matching defs:rc
36 struct dlm_rcom *rc;
49 rc = (struct dlm_rcom *) mb;
51 rc->rc_header.h_version = (DLM_HEADER_MAJOR | DLM_HEADER_MINOR);
52 rc->rc_header.h_lockspace = ls->ls_global_id;
53 rc->rc_header.h_nodeid = dlm_our_nodeid();
54 rc->rc_header.h_length = mb_len;
55 rc->rc_header.h_cmd = DLM_RCOM;
57 rc->rc_type = type;
60 rc->rc_seq = ls->ls_recover_seq;
64 *rc_ret = rc;
69 struct dlm_rcom *rc)
71 dlm_rcom_out(rc);
85 static int check_config(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid)
87 struct rcom_config *rf = (struct rcom_config *) rc->rc_buf;
90 if ((rc->rc_header.h_version & 0xFFFF0000) != DLM_HEADER_MAJOR) {
93 rc->rc_header.h_version);
97 if (rc->rc_header.h_length < conf_size) {
99 rc->rc_header.h_length, nodeid);
132 struct dlm_rcom *rc;
139 rc = ls->ls_recover_buf;
140 rc->rc_result = dlm_recover_status(ls);
144 error = create_rcom(ls, nodeid, DLM_RCOM_STATUS, 0, &rc, &mh);
148 allow_sync_reply(ls, &rc->rc_id);
151 send_rcom(ls, mh, rc);
158 rc = ls->ls_recover_buf;
160 if (rc->rc_result == -ESRCH) {
163 rc->rc_result = 0;
165 error = check_config(ls, rc, nodeid);
173 struct dlm_rcom *rc;
178 sizeof(struct rcom_config), &rc, &mh);
181 rc->rc_id = rc_in->rc_id;
182 rc->rc_seq_reply = rc_in->rc_seq;
183 rc->rc_result = dlm_recover_status(ls);
184 make_config(ls, (struct rcom_config *) rc->rc_buf);
186 send_rcom(ls, mh, rc);
210 struct dlm_rcom *rc;
226 error = create_rcom(ls, nodeid, DLM_RCOM_NAMES, last_len, &rc, &mh);
229 memcpy(rc->rc_buf, last_name, last_len);
231 allow_sync_reply(ls, &rc->rc_id);
234 send_rcom(ls, mh, rc);
244 struct dlm_rcom *rc;
252 error = create_rcom(ls, nodeid, DLM_RCOM_NAMES_REPLY, outlen, &rc, &mh);
255 rc->rc_id = rc_in->rc_id;
256 rc->rc_seq_reply = rc_in->rc_seq;
258 dlm_copy_master_names(ls, rc_in->rc_buf, inlen, rc->rc_buf, outlen,
260 send_rcom(ls, mh, rc);
265 struct dlm_rcom *rc;
271 &rc, &mh);
274 memcpy(rc->rc_buf, r->res_name, r->res_length);
275 rc->rc_id = (unsigned long) r;
277 send_rcom(ls, mh, rc);
284 struct dlm_rcom *rc;
289 error = create_rcom(ls, nodeid, DLM_RCOM_LOOKUP_REPLY, 0, &rc, &mh);
296 rc->rc_result = ret_nodeid;
297 rc->rc_id = rc_in->rc_id;
298 rc->rc_seq_reply = rc_in->rc_seq;
300 send_rcom(ls, mh, rc);
339 struct dlm_rcom *rc;
347 error = create_rcom(ls, r->res_nodeid, DLM_RCOM_LOCK, len, &rc, &mh);
351 rl = (struct rcom_lock *) rc->rc_buf;
353 rc->rc_id = (unsigned long) r;
355 send_rcom(ls, mh, rc);
363 struct dlm_rcom *rc;
370 sizeof(struct rcom_lock), &rc, &mh);
377 memcpy(rc->rc_buf, rc_in->rc_buf, sizeof(struct rcom_lock));
378 rc->rc_id = rc_in->rc_id;
379 rc->rc_seq_reply = rc_in->rc_seq;
381 send_rcom(ls, mh, rc);
389 struct dlm_rcom *rc;
400 rc = (struct dlm_rcom *) mb;
402 rc->rc_header.h_version = (DLM_HEADER_MAJOR | DLM_HEADER_MINOR);
403 rc->rc_header.h_lockspace = rc_in->rc_header.h_lockspace;
404 rc->rc_header.h_nodeid = dlm_our_nodeid();
405 rc->rc_header.h_length = mb_len;
406 rc->rc_header.h_cmd = DLM_RCOM;
408 rc->rc_type = DLM_RCOM_STATUS_REPLY;
409 rc->rc_id = rc_in->rc_id;
410 rc->rc_seq_reply = rc_in->rc_seq;
411 rc->rc_result = -ESRCH;
413 rf = (struct rcom_config *) rc->rc_buf;
416 dlm_rcom_out(rc);
422 static int is_old_reply(struct dlm_ls *ls, struct dlm_rcom *rc)
427 switch (rc->rc_type) {
435 if (rc->rc_seq_reply != seq) {
438 rc->rc_type, rc->rc_header.h_nodeid,
439 (unsigned long long)rc->rc_seq_reply,
450 void dlm_receive_rcom(struct dlm_ls *ls, struct dlm_rcom *rc, int nodeid)
454 if (dlm_recovery_stopped(ls) && (rc->rc_type != DLM_RCOM_STATUS)) {
456 rc->rc_type, nodeid);
460 if (is_old_reply(ls, rc))
463 switch (rc->rc_type) {
465 receive_rcom_status(ls, rc);
469 receive_rcom_names(ls, rc);
473 receive_rcom_lookup(ls, rc);
477 if (rc->rc_header.h_length < lock_size)
479 receive_rcom_lock(ls, rc);
483 receive_sync_reply(ls, rc);
487 receive_sync_reply(ls, rc);
491 receive_rcom_lookup_reply(ls, rc);
495 if (rc->rc_header.h_length < lock_size)
497 dlm_recover_process_copy(ls, rc);
501 log_error(ls, "receive_rcom bad type %d", rc->rc_type);
507 rc->rc_type, nodeid);