/* send_args send_common send_request receive_request send_convert receive_convert send_unlock receive_unlock send_cancel receive_cancel send_grant receive_grant send_bast receive_bast send_lookup receive_lookup send_remove receive_remove  */
static int _create_message(struct dlm_ls *ls, int mb_len, int to_nodeid, int mstype, struct dlm_message **ms_ret, struct dlm_mhandle **mh_ret)
/* send_args send_common send_request receive_request send_convert receive_convert send_unlock receive_unlock send_cancel receive_cancel send_grant receive_grant send_bast receive_bast send_lookup receive_lookup send_remove receive_remove  */
static int _create_message(struct dlm_ls *ls, int mb_len, int to_nodeid, int mstype, struct dlm_message **ms_ret, struct dlm_mhandle **mh_ret)
{
	struct dlm_message *ms;
	struct dlm_mhandle *mh;
	char *mb;
	mh = dlm_lowcomms_get_buffer(to_nodeid, mb_len, GFP_NOFS, &mb);
	if (!mh)
		return -ENOBUFS;
	memset(mb, 0, mb_len);
	ms = (struct dlm_message *) mb;
	ms->m_header.h_version = (DLM_HEADER_MAJOR | DLM_HEADER_MINOR);
	ms->m_header.h_lockspace = ls->ls_global_id;
	ms->m_header.h_nodeid = dlm_our_nodeid();
	ms->m_header.h_length = mb_len;
	ms->m_header.h_cmd = DLM_MSG;
	ms->m_type = mstype;
	*mh_ret = mh;
	*ms_ret = ms;
	return 0;
}