Lines Matching refs:mh

287 	struct dlm_mhandle *mh = container_of(rcu, struct dlm_mhandle, rcu);  in dlm_mhandle_release()  local
289 dlm_lowcomms_put_msg(mh->msg); in dlm_mhandle_release()
290 dlm_free_mhandle(mh); in dlm_mhandle_release()
294 struct dlm_mhandle *mh) in dlm_mhandle_delete() argument
296 list_del_rcu(&mh->list); in dlm_mhandle_delete()
298 call_rcu(&mh->rcu, dlm_mhandle_release); in dlm_mhandle_delete()
303 struct dlm_mhandle *mh; in dlm_send_queue_flush() local
309 list_for_each_entry_rcu(mh, &node->send_queue, list) { in dlm_send_queue_flush()
310 dlm_mhandle_delete(node, mh); in dlm_send_queue_flush()
401 struct dlm_mhandle *mh; in dlm_send_fin() local
404 mh = dlm_midcomms_get_mhandle(node->nodeid, mb_len, GFP_NOFS, &ppc); in dlm_send_fin()
405 if (!mh) in dlm_send_fin()
408 mh->ack_rcv = ack_rcv; in dlm_send_fin()
418 dlm_midcomms_commit_mhandle(mh); in dlm_send_fin()
426 struct dlm_mhandle *mh; in dlm_receive_ack() local
429 list_for_each_entry_rcu(mh, &node->send_queue, list) { in dlm_receive_ack()
430 if (before(mh->seq, seq)) { in dlm_receive_ack()
431 if (mh->ack_rcv) in dlm_receive_ack()
432 mh->ack_rcv(node); in dlm_receive_ack()
440 list_for_each_entry_rcu(mh, &node->send_queue, list) { in dlm_receive_ack()
441 if (before(mh->seq, seq)) { in dlm_receive_ack()
442 dlm_mhandle_delete(node, mh); in dlm_receive_ack()
984 struct dlm_mhandle *mh; in dlm_midcomms_unack_msg_resend() local
1004 list_for_each_entry_rcu(mh, &node->send_queue, list) { in dlm_midcomms_unack_msg_resend()
1005 if (!mh->committed) in dlm_midcomms_unack_msg_resend()
1008 ret = dlm_lowcomms_resend_msg(mh->msg); in dlm_midcomms_unack_msg_resend()
1011 mh->seq, node->nodeid); in dlm_midcomms_unack_msg_resend()
1029 struct dlm_mhandle *mh = data; in midcomms_new_msg_cb() local
1031 atomic_inc(&mh->node->send_queue_cnt); in midcomms_new_msg_cb()
1033 spin_lock(&mh->node->send_queue_lock); in midcomms_new_msg_cb()
1034 list_add_tail_rcu(&mh->list, &mh->node->send_queue); in midcomms_new_msg_cb()
1035 spin_unlock(&mh->node->send_queue_lock); in midcomms_new_msg_cb()
1037 mh->seq = mh->node->seq_send++; in midcomms_new_msg_cb()
1040 static struct dlm_msg *dlm_midcomms_get_msg_3_2(struct dlm_mhandle *mh, int nodeid, in dlm_midcomms_get_msg_3_2() argument
1047 allocation, ppc, midcomms_new_msg_cb, mh); in dlm_midcomms_get_msg_3_2()
1052 mh->opts = opts; in dlm_midcomms_get_msg_3_2()
1055 dlm_fill_opts_header(opts, len, mh->seq); in dlm_midcomms_get_msg_3_2()
1058 mh->inner_hd = (const struct dlm_header *)*ppc; in dlm_midcomms_get_msg_3_2()
1070 struct dlm_mhandle *mh; in dlm_midcomms_get_mhandle() local
1084 mh = dlm_allocate_mhandle(); in dlm_midcomms_get_mhandle()
1085 if (!mh) in dlm_midcomms_get_mhandle()
1088 mh->committed = false; in dlm_midcomms_get_mhandle()
1089 mh->ack_rcv = NULL; in dlm_midcomms_get_mhandle()
1090 mh->idx = idx; in dlm_midcomms_get_mhandle()
1091 mh->node = node; in dlm_midcomms_get_mhandle()
1098 dlm_free_mhandle(mh); in dlm_midcomms_get_mhandle()
1104 msg = dlm_midcomms_get_msg_3_2(mh, nodeid, len, allocation, in dlm_midcomms_get_mhandle()
1107 dlm_free_mhandle(mh); in dlm_midcomms_get_mhandle()
1113 dlm_free_mhandle(mh); in dlm_midcomms_get_mhandle()
1118 mh->msg = msg; in dlm_midcomms_get_mhandle()
1125 return mh; in dlm_midcomms_get_mhandle()
1133 static void dlm_midcomms_commit_msg_3_2(struct dlm_mhandle *mh) in dlm_midcomms_commit_msg_3_2() argument
1136 mh->opts->o_nextcmd = mh->inner_hd->h_cmd; in dlm_midcomms_commit_msg_3_2()
1137 mh->committed = true; in dlm_midcomms_commit_msg_3_2()
1138 dlm_lowcomms_commit_msg(mh->msg); in dlm_midcomms_commit_msg_3_2()
1145 void dlm_midcomms_commit_mhandle(struct dlm_mhandle *mh) in dlm_midcomms_commit_mhandle() argument
1147 switch (mh->node->version) { in dlm_midcomms_commit_mhandle()
1149 srcu_read_unlock(&nodes_srcu, mh->idx); in dlm_midcomms_commit_mhandle()
1151 dlm_lowcomms_commit_msg(mh->msg); in dlm_midcomms_commit_mhandle()
1152 dlm_lowcomms_put_msg(mh->msg); in dlm_midcomms_commit_mhandle()
1154 dlm_free_mhandle(mh); in dlm_midcomms_commit_mhandle()
1157 dlm_midcomms_commit_msg_3_2(mh); in dlm_midcomms_commit_mhandle()
1158 srcu_read_unlock(&nodes_srcu, mh->idx); in dlm_midcomms_commit_mhandle()
1161 srcu_read_unlock(&nodes_srcu, mh->idx); in dlm_midcomms_commit_mhandle()