Lines Matching refs:msg
693 struct dlm_msg *msg = container_of(kref, struct dlm_msg, ref); in dlm_msg_release() local
695 kref_put(&msg->entry->ref, dlm_page_release); in dlm_msg_release()
696 dlm_free_msg(msg); in dlm_msg_release()
701 struct dlm_msg *msg, *tmp; in free_entry() local
703 list_for_each_entry_safe(msg, tmp, &e->msgs, list) { in free_entry()
704 if (msg->orig_msg) { in free_entry()
705 msg->orig_msg->retransmit = false; in free_entry()
706 kref_put(&msg->orig_msg->ref, dlm_msg_release); in free_entry()
709 list_del(&msg->list); in free_entry()
710 kref_put(&msg->ref, dlm_msg_release); in free_entry()
905 struct msghdr msg; in receive_from_sock() local
920 memset(&msg, 0, sizeof(msg)); in receive_from_sock()
921 msg.msg_flags = MSG_DONTWAIT | MSG_NOSIGNAL; in receive_from_sock()
924 ret = kernel_recvmsg(con->sock, &msg, &iov, 1, iov.iov_len, in receive_from_sock()
925 msg.msg_flags); in receive_from_sock()
1233 struct dlm_msg *msg; in dlm_lowcomms_new_msg_con() local
1235 msg = dlm_allocate_msg(); in dlm_lowcomms_new_msg_con()
1236 if (!msg) in dlm_lowcomms_new_msg_con()
1239 kref_init(&msg->ref); in dlm_lowcomms_new_msg_con()
1243 dlm_free_msg(msg); in dlm_lowcomms_new_msg_con()
1247 msg->retransmit = false; in dlm_lowcomms_new_msg_con()
1248 msg->orig_msg = NULL; in dlm_lowcomms_new_msg_con()
1249 msg->ppc = *ppc; in dlm_lowcomms_new_msg_con()
1250 msg->len = len; in dlm_lowcomms_new_msg_con()
1251 msg->entry = e; in dlm_lowcomms_new_msg_con()
1253 return msg; in dlm_lowcomms_new_msg_con()
1264 struct dlm_msg *msg; in dlm_lowcomms_new_msg() local
1282 msg = dlm_lowcomms_new_msg_con(con, len, ppc, cb, data); in dlm_lowcomms_new_msg()
1283 if (!msg) { in dlm_lowcomms_new_msg()
1289 kref_get(&msg->ref); in dlm_lowcomms_new_msg()
1291 msg->idx = idx; in dlm_lowcomms_new_msg()
1292 return msg; in dlm_lowcomms_new_msg()
1296 static void _dlm_lowcomms_commit_msg(struct dlm_msg *msg) in _dlm_lowcomms_commit_msg() argument
1298 struct writequeue_entry *e = msg->entry; in _dlm_lowcomms_commit_msg()
1303 kref_get(&msg->ref); in _dlm_lowcomms_commit_msg()
1304 list_add(&msg->list, &e->msgs); in _dlm_lowcomms_commit_msg()
1323 void dlm_lowcomms_commit_msg(struct dlm_msg *msg) in dlm_lowcomms_commit_msg() argument
1325 _dlm_lowcomms_commit_msg(msg); in dlm_lowcomms_commit_msg()
1326 srcu_read_unlock(&connections_srcu, msg->idx); in dlm_lowcomms_commit_msg()
1328 kref_put(&msg->ref, dlm_msg_release); in dlm_lowcomms_commit_msg()
1332 void dlm_lowcomms_put_msg(struct dlm_msg *msg) in dlm_lowcomms_put_msg() argument
1334 kref_put(&msg->ref, dlm_msg_release); in dlm_lowcomms_put_msg()
1338 int dlm_lowcomms_resend_msg(struct dlm_msg *msg) in dlm_lowcomms_resend_msg() argument
1343 if (msg->retransmit) in dlm_lowcomms_resend_msg()
1346 msg_resend = dlm_lowcomms_new_msg_con(msg->entry->con, msg->len, &ppc, in dlm_lowcomms_resend_msg()
1351 msg->retransmit = true; in dlm_lowcomms_resend_msg()
1352 kref_get(&msg->ref); in dlm_lowcomms_resend_msg()
1353 msg_resend->orig_msg = msg; in dlm_lowcomms_resend_msg()
1355 memcpy(ppc, msg->ppc, msg->len); in dlm_lowcomms_resend_msg()
1367 struct msghdr msg = { in send_to_sock() local
1386 iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, &bvec, 1, len); in send_to_sock()
1387 ret = sock_sendmsg(con->sock, &msg); in send_to_sock()