aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/sctp/structs.h
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2017-05-31 04:36:31 -0400
committerDavid S. Miller <davem@davemloft.net>2017-06-02 13:56:26 -0400
commitcee360ab4dd66fc1de33a5fa1cb418fa21c27ce3 (patch)
treedb9b8575e7392b314e94a946590b71bb5c856e64 /include/net/sctp/structs.h
parent6e7da286e3513ac1e107ef8dffa5f254029d68e7 (diff)
sctp: define the member stream as an object instead of pointer in asoc
As Marcelo's suggestion, stream is a fixed size member of asoc and would not grow with more streams. To avoid an allocation for it, this patch is to define it as an object instead of pointer and update the places using it, also create sctp_stream_update() called in sctp_assoc_update() to migrate the stream info from one stream to another. Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sctp/structs.h')
-rw-r--r--include/net/sctp/structs.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index a8b38e123f97..c8dbf410c4f5 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -381,6 +381,7 @@ int sctp_stream_new(struct sctp_association *asoc, gfp_t gfp);
381int sctp_stream_init(struct sctp_association *asoc, gfp_t gfp); 381int sctp_stream_init(struct sctp_association *asoc, gfp_t gfp);
382void sctp_stream_free(struct sctp_stream *stream); 382void sctp_stream_free(struct sctp_stream *stream);
383void sctp_stream_clear(struct sctp_stream *stream); 383void sctp_stream_clear(struct sctp_stream *stream);
384void sctp_stream_update(struct sctp_stream *stream, struct sctp_stream *new);
384 385
385/* What is the current SSN number for this stream? */ 386/* What is the current SSN number for this stream? */
386#define sctp_ssn_peek(stream, type, sid) \ 387#define sctp_ssn_peek(stream, type, sid) \
@@ -1750,7 +1751,7 @@ struct sctp_association {
1750 __u32 default_rcv_context; 1751 __u32 default_rcv_context;
1751 1752
1752 /* Stream arrays */ 1753 /* Stream arrays */
1753 struct sctp_stream *stream; 1754 struct sctp_stream stream;
1754 1755
1755 /* All outbound chunks go through this structure. */ 1756 /* All outbound chunks go through this structure. */
1756 struct sctp_outq outqueue; 1757 struct sctp_outq outqueue;