rcom.c (c4f4e135c27b503d325d414819831909023b113d) rcom.c (b9d2f6ada0083bad46f37a1238fea718b575e0fa)
1// SPDX-License-Identifier: GPL-2.0-only
2/******************************************************************************
3*******************************************************************************
4**
5** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
6** Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved.
7**
8**

--- 458 unchanged lines hidden (view full) ---

467 out:
468 return error;
469}
470
471/* needs at least dlm_rcom + rcom_lock */
472static void receive_rcom_lock(struct dlm_ls *ls, struct dlm_rcom *rc_in,
473 uint64_t seq)
474{
1// SPDX-License-Identifier: GPL-2.0-only
2/******************************************************************************
3*******************************************************************************
4**
5** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
6** Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved.
7**
8**

--- 458 unchanged lines hidden (view full) ---

467 out:
468 return error;
469}
470
471/* needs at least dlm_rcom + rcom_lock */
472static void receive_rcom_lock(struct dlm_ls *ls, struct dlm_rcom *rc_in,
473 uint64_t seq)
474{
475 __le32 rl_remid, rl_result;
476 struct rcom_lock *rl;
475 struct dlm_rcom *rc;
476 struct dlm_mhandle *mh;
477 int error, nodeid = le32_to_cpu(rc_in->rc_header.h_nodeid);
478
477 struct dlm_rcom *rc;
478 struct dlm_mhandle *mh;
479 int error, nodeid = le32_to_cpu(rc_in->rc_header.h_nodeid);
480
479 dlm_recover_master_copy(ls, rc_in);
481 dlm_recover_master_copy(ls, rc_in, &rl_remid, &rl_result);
480
481 error = create_rcom(ls, nodeid, DLM_RCOM_LOCK_REPLY,
482 sizeof(struct rcom_lock), &rc, &mh, seq);
483 if (error)
484 return;
485
482
483 error = create_rcom(ls, nodeid, DLM_RCOM_LOCK_REPLY,
484 sizeof(struct rcom_lock), &rc, &mh, seq);
485 if (error)
486 return;
487
486 /* We send back the same rcom_lock struct we received, but
487 dlm_recover_master_copy() has filled in rl_remid and rl_result */
488
489 memcpy(rc->rc_buf, rc_in->rc_buf, sizeof(struct rcom_lock));
488 memcpy(rc->rc_buf, rc_in->rc_buf, sizeof(struct rcom_lock));
489 rl = (struct rcom_lock *)rc->rc_buf;
490 /* set rl_remid and rl_result from dlm_recover_master_copy() */
491 rl->rl_remid = rl_remid;
492 rl->rl_result = rl_result;
493
490 rc->rc_id = rc_in->rc_id;
491 rc->rc_seq_reply = rc_in->rc_seq;
492
493 send_rcom(mh, rc);
494}
495
496/* If the lockspace doesn't exist then still send a status message
497 back; it's possible that it just doesn't have its global_id yet. */

--- 189 unchanged lines hidden ---
494 rc->rc_id = rc_in->rc_id;
495 rc->rc_seq_reply = rc_in->rc_seq;
496
497 send_rcom(mh, rc);
498}
499
500/* If the lockspace doesn't exist then still send a status message
501 back; it's possible that it just doesn't have its global_id yet. */

--- 189 unchanged lines hidden ---