Commit 88aa023a authored by Alexander Aring's avatar Alexander Aring Committed by David Teigland

fs: dlm: cleanup and remove _send_rcom

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: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent 052849be
...@@ -89,22 +89,15 @@ static int create_rcom_stateless(struct dlm_ls *ls, int to_nodeid, int type, ...@@ -89,22 +89,15 @@ static int create_rcom_stateless(struct dlm_ls *ls, int to_nodeid, int type,
return 0; 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); 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); dlm_midcomms_commit_mhandle(mh);
} }
static void send_rcom_stateless(struct dlm_ls *ls, struct dlm_msg *msg, static void send_rcom_stateless(struct dlm_msg *msg, struct dlm_rcom *rc)
struct dlm_rcom *rc)
{ {
_send_rcom(ls, rc); dlm_rcom_out(rc);
dlm_lowcomms_commit_msg(msg); dlm_lowcomms_commit_msg(msg);
dlm_lowcomms_put_msg(msg); dlm_lowcomms_put_msg(msg);
} }
...@@ -204,7 +197,7 @@ int dlm_rcom_status(struct dlm_ls *ls, int nodeid, uint32_t status_flags) ...@@ -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); allow_sync_reply(ls, &rc->rc_id);
memset(ls->ls_recover_buf, 0, DLM_MAX_SOCKET_BUFSIZE); 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); error = dlm_wait_function(ls, &rcom_response);
disallow_sync_reply(ls); disallow_sync_reply(ls);
...@@ -287,7 +280,7 @@ static void receive_rcom_status(struct dlm_ls *ls, struct dlm_rcom *rc_in) ...@@ -287,7 +280,7 @@ static void receive_rcom_status(struct dlm_ls *ls, struct dlm_rcom *rc_in)
spin_unlock(&ls->ls_recover_lock); spin_unlock(&ls->ls_recover_lock);
do_send: 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) static void receive_sync_reply(struct dlm_ls *ls, struct dlm_rcom *rc_in)
...@@ -327,7 +320,7 @@ int dlm_rcom_names(struct dlm_ls *ls, int nodeid, char *last_name, int last_len) ...@@ -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); allow_sync_reply(ls, &rc->rc_id);
memset(ls->ls_recover_buf, 0, DLM_MAX_SOCKET_BUFSIZE); 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); error = dlm_wait_function(ls, &rcom_response);
disallow_sync_reply(ls); disallow_sync_reply(ls);
...@@ -356,7 +349,7 @@ static void receive_rcom_names(struct dlm_ls *ls, struct dlm_rcom *rc_in) ...@@ -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, dlm_copy_master_names(ls, rc_in->rc_buf, inlen, rc->rc_buf, outlen,
nodeid); nodeid);
send_rcom_stateless(ls, msg, rc); send_rcom_stateless(msg, rc);
} }
int dlm_send_rcom_lookup(struct dlm_rsb *r, int dir_nodeid) int dlm_send_rcom_lookup(struct dlm_rsb *r, int dir_nodeid)
...@@ -373,7 +366,7 @@ int dlm_send_rcom_lookup(struct dlm_rsb *r, int dir_nodeid) ...@@ -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); memcpy(rc->rc_buf, r->res_name, r->res_length);
rc->rc_id = (unsigned long) r->res_id; rc->rc_id = (unsigned long) r->res_id;
send_rcom(ls, mh, rc); send_rcom(mh, rc);
out: out:
return error; return error;
} }
...@@ -404,7 +397,7 @@ static void receive_rcom_lookup(struct dlm_ls *ls, struct dlm_rcom *rc_in) ...@@ -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_id = rc_in->rc_id;
rc->rc_seq_reply = rc_in->rc_seq; 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) static void receive_rcom_lookup_reply(struct dlm_ls *ls, struct dlm_rcom *rc_in)
...@@ -461,7 +454,7 @@ int dlm_send_rcom_lock(struct dlm_rsb *r, struct dlm_lkb *lkb) ...@@ -461,7 +454,7 @@ int dlm_send_rcom_lock(struct dlm_rsb *r, struct dlm_lkb *lkb)
pack_rcom_lock(r, lkb, rl); pack_rcom_lock(r, lkb, rl);
rc->rc_id = (unsigned long) r; rc->rc_id = (unsigned long) r;
send_rcom(ls, mh, rc); send_rcom(mh, rc);
out: out:
return error; return error;
} }
...@@ -487,7 +480,7 @@ static void receive_rcom_lock(struct dlm_ls *ls, struct dlm_rcom *rc_in) ...@@ -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_id = rc_in->rc_id;
rc->rc_seq_reply = rc_in->rc_seq; 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 /* If the lockspace doesn't exist then still send a status message
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment