• Home
  • Raw
  • Download

Lines Matching refs:msg

35 static void sctp_datamsg_init(struct sctp_datamsg *msg)  in sctp_datamsg_init()  argument
37 refcount_set(&msg->refcnt, 1); in sctp_datamsg_init()
38 msg->send_failed = 0; in sctp_datamsg_init()
39 msg->send_error = 0; in sctp_datamsg_init()
40 msg->can_delay = 1; in sctp_datamsg_init()
41 msg->abandoned = 0; in sctp_datamsg_init()
42 msg->expires_at = 0; in sctp_datamsg_init()
43 INIT_LIST_HEAD(&msg->chunks); in sctp_datamsg_init()
49 struct sctp_datamsg *msg; in sctp_datamsg_new() local
50 msg = kmalloc(sizeof(struct sctp_datamsg), gfp); in sctp_datamsg_new()
51 if (msg) { in sctp_datamsg_new()
52 sctp_datamsg_init(msg); in sctp_datamsg_new()
55 return msg; in sctp_datamsg_new()
58 void sctp_datamsg_free(struct sctp_datamsg *msg) in sctp_datamsg_free() argument
65 list_for_each_entry(chunk, &msg->chunks, frag_list) in sctp_datamsg_free()
68 sctp_datamsg_put(msg); in sctp_datamsg_free()
72 static void sctp_datamsg_destroy(struct sctp_datamsg *msg) in sctp_datamsg_destroy() argument
81 notify = msg->send_failed ? -1 : 0; in sctp_datamsg_destroy()
84 list_for_each_safe(pos, temp, &msg->chunks) { in sctp_datamsg_destroy()
90 if (msg->send_error) in sctp_datamsg_destroy()
91 error = msg->send_error; in sctp_datamsg_destroy()
117 kfree(msg); in sctp_datamsg_destroy()
121 static void sctp_datamsg_hold(struct sctp_datamsg *msg) in sctp_datamsg_hold() argument
123 refcount_inc(&msg->refcnt); in sctp_datamsg_hold()
127 void sctp_datamsg_put(struct sctp_datamsg *msg) in sctp_datamsg_put() argument
129 if (refcount_dec_and_test(&msg->refcnt)) in sctp_datamsg_put()
130 sctp_datamsg_destroy(msg); in sctp_datamsg_put()
134 static void sctp_datamsg_assign(struct sctp_datamsg *msg, struct sctp_chunk *chunk) in sctp_datamsg_assign() argument
136 sctp_datamsg_hold(msg); in sctp_datamsg_assign()
137 chunk->msg = msg; in sctp_datamsg_assign()
157 struct sctp_datamsg *msg; in sctp_datamsg_from_user() local
160 msg = sctp_datamsg_new(GFP_KERNEL); in sctp_datamsg_from_user()
161 if (!msg) in sctp_datamsg_from_user()
170 msg->expires_at = jiffies + in sctp_datamsg_from_user()
228 msg->can_delay = 0; in sctp_datamsg_from_user()
281 sctp_datamsg_assign(msg, chunk); in sctp_datamsg_from_user()
282 list_add_tail(&chunk->frag_list, &msg->chunks); in sctp_datamsg_from_user()
285 return msg; in sctp_datamsg_from_user()
291 list_for_each_safe(pos, temp, &msg->chunks) { in sctp_datamsg_from_user()
296 sctp_datamsg_put(msg); in sctp_datamsg_from_user()
307 if (chunk->msg->abandoned) in sctp_chunk_abandoned()
315 time_after(jiffies, chunk->msg->expires_at)) { in sctp_chunk_abandoned()
327 chunk->msg->abandoned = 1; in sctp_chunk_abandoned()
337 chunk->msg->abandoned = 1; in sctp_chunk_abandoned()
340 chunk->msg->expires_at && in sctp_chunk_abandoned()
341 time_after(jiffies, chunk->msg->expires_at)) { in sctp_chunk_abandoned()
342 chunk->msg->abandoned = 1; in sctp_chunk_abandoned()
353 chunk->msg->send_failed = 1; in sctp_chunk_fail()
354 chunk->msg->send_error = error; in sctp_chunk_fail()