Lines Matching defs:msg

35 static void sctp_datamsg_init(struct sctp_datamsg *msg)
37 refcount_set(&msg->refcnt, 1);
38 msg->send_failed = 0;
39 msg->send_error = 0;
40 msg->can_delay = 1;
41 msg->abandoned = 0;
42 msg->expires_at = 0;
43 INIT_LIST_HEAD(&msg->chunks);
49 struct sctp_datamsg *msg;
50 msg = kmalloc(sizeof(struct sctp_datamsg), gfp);
51 if (msg) {
52 sctp_datamsg_init(msg);
55 return msg;
58 void sctp_datamsg_free(struct sctp_datamsg *msg)
65 list_for_each_entry(chunk, &msg->chunks, frag_list)
68 sctp_datamsg_put(msg);
72 static void sctp_datamsg_destroy(struct sctp_datamsg *msg)
81 list_for_each_safe(pos, temp, &msg->chunks) {
85 if (!msg->send_failed) {
91 error = msg->send_error ?: asoc->outqueue.error;
115 kfree(msg);
119 static void sctp_datamsg_hold(struct sctp_datamsg *msg)
121 refcount_inc(&msg->refcnt);
125 void sctp_datamsg_put(struct sctp_datamsg *msg)
127 if (refcount_dec_and_test(&msg->refcnt))
128 sctp_datamsg_destroy(msg);
132 static void sctp_datamsg_assign(struct sctp_datamsg *msg, struct sctp_chunk *chunk)
134 sctp_datamsg_hold(msg);
135 chunk->msg = msg;
155 struct sctp_datamsg *msg;
158 msg = sctp_datamsg_new(GFP_KERNEL);
159 if (!msg)
168 msg->expires_at = jiffies +
226 msg->can_delay = 0;
279 sctp_datamsg_assign(msg, chunk);
280 list_add_tail(&chunk->frag_list, &msg->chunks);
283 return msg;
289 list_for_each_safe(pos, temp, &msg->chunks) {
294 sctp_datamsg_put(msg);
305 if (chunk->msg->abandoned)
313 time_after(jiffies, chunk->msg->expires_at)) {
325 chunk->msg->abandoned = 1;
335 chunk->msg->abandoned = 1;
338 chunk->msg->expires_at &&
339 time_after(jiffies, chunk->msg->expires_at)) {
340 chunk->msg->abandoned = 1;
351 chunk->msg->send_failed = 1;
352 chunk->msg->send_error = error;