Skip to content

Commit

Permalink
fs: dlm: cleanup and remove _send_rcom
Browse files Browse the repository at this point in the history
The _send_rcom() can be removed and we call directly dlm_rcom_out().
As we doing that we removing the struct dlm_ls parameter which isn't
used.

Signed-off-by: Alexander Aring <[email protected]>
Signed-off-by: David Teigland <[email protected]>
  • Loading branch information
Alexander Aring authored and teigland committed Jul 19, 2021
1 parent 052849b commit 88aa023
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions fs/dlm/rcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,15 @@ static int create_rcom_stateless(struct dlm_ls *ls, int to_nodeid, int type,
return 0;
}

static void _send_rcom(struct dlm_ls *ls, struct dlm_rcom *rc)
static void send_rcom(struct dlm_mhandle *mh, struct dlm_rcom *rc)
{
dlm_rcom_out(rc);
}

static void send_rcom(struct dlm_ls *ls, struct dlm_mhandle *mh,
struct dlm_rcom *rc)
{
_send_rcom(ls, rc);
dlm_midcomms_commit_mhandle(mh);
}

static void send_rcom_stateless(struct dlm_ls *ls, struct dlm_msg *msg,
struct dlm_rcom *rc)
static void send_rcom_stateless(struct dlm_msg *msg, struct dlm_rcom *rc)
{
_send_rcom(ls, rc);
dlm_rcom_out(rc);
dlm_lowcomms_commit_msg(msg);
dlm_lowcomms_put_msg(msg);
}
Expand Down Expand Up @@ -204,7 +197,7 @@ int dlm_rcom_status(struct dlm_ls *ls, int nodeid, uint32_t status_flags)
allow_sync_reply(ls, &rc->rc_id);
memset(ls->ls_recover_buf, 0, DLM_MAX_SOCKET_BUFSIZE);

send_rcom_stateless(ls, msg, rc);
send_rcom_stateless(msg, rc);

error = dlm_wait_function(ls, &rcom_response);
disallow_sync_reply(ls);
Expand Down Expand Up @@ -287,7 +280,7 @@ static void receive_rcom_status(struct dlm_ls *ls, struct dlm_rcom *rc_in)
spin_unlock(&ls->ls_recover_lock);

do_send:
send_rcom_stateless(ls, msg, rc);
send_rcom_stateless(msg, rc);
}

static void receive_sync_reply(struct dlm_ls *ls, struct dlm_rcom *rc_in)
Expand Down Expand Up @@ -327,7 +320,7 @@ int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name, int last_len)
allow_sync_reply(ls, &rc->rc_id);
memset(ls->ls_recover_buf, 0, DLM_MAX_SOCKET_BUFSIZE);

send_rcom_stateless(ls, msg, rc);
send_rcom_stateless(msg, rc);

error = dlm_wait_function(ls, &rcom_response);
disallow_sync_reply(ls);
Expand Down Expand Up @@ -356,7 +349,7 @@ static void receive_rcom_names(struct dlm_ls *ls, struct dlm_rcom *rc_in)

dlm_copy_master_names(ls, rc_in->rc_buf, inlen, rc->rc_buf, outlen,
nodeid);
send_rcom_stateless(ls, msg, rc);
send_rcom_stateless(msg, rc);
}

int dlm_send_rcom_lookup(struct dlm_rsb *r, int dir_nodeid)
Expand All @@ -373,7 +366,7 @@ int dlm_send_rcom_lookup(struct dlm_rsb *r, int dir_nodeid)
memcpy(rc->rc_buf, r->res_name, r->res_length);
rc->rc_id = (unsigned long) r->res_id;

send_rcom(ls, mh, rc);
send_rcom(mh, rc);
out:
return error;
}
Expand Down Expand Up @@ -404,7 +397,7 @@ static void receive_rcom_lookup(struct dlm_ls *ls, struct dlm_rcom *rc_in)
rc->rc_id = rc_in->rc_id;
rc->rc_seq_reply = rc_in->rc_seq;

send_rcom(ls, mh, rc);
send_rcom(mh, rc);
}

static void receive_rcom_lookup_reply(struct dlm_ls *ls, struct dlm_rcom *rc_in)
Expand Down Expand Up @@ -461,7 +454,7 @@ int dlm_send_rcom_lock(struct dlm_rsb *r, struct dlm_lkb *lkb)
pack_rcom_lock(r, lkb, rl);
rc->rc_id = (unsigned long) r;

send_rcom(ls, mh, rc);
send_rcom(mh, rc);
out:
return error;
}
Expand All @@ -487,7 +480,7 @@ static void receive_rcom_lock(struct dlm_ls *ls, struct dlm_rcom *rc_in)
rc->rc_id = rc_in->rc_id;
rc->rc_seq_reply = rc_in->rc_seq;

send_rcom(ls, mh, rc);
send_rcom(mh, rc);
}

/* If the lockspace doesn't exist then still send a status message
Expand Down

0 comments on commit 88aa023

Please sign in to comment.