diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-15 06:11:23 (GMT) |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-24 10:16:40 (GMT) |
commit | e0eb093e794452791b0f932a0120f410f614ad82 (patch) | |
tree | 598ab3c7b9f2d179e3b3c318cc0619e304c2bd5f /net/sctp/chunk.c | |
parent | 8feb2fb2bb986c533e18037d3c45a5f779421992 (diff) | |
download | linux-e0eb093e794452791b0f932a0120f410f614ad82.tar.xz |
switch sctp_user_addto_chunk() and sctp_datamsg_from_user() to passing iov_iter
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/sctp/chunk.c')
-rw-r--r-- | net/sctp/chunk.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/sctp/chunk.c b/net/sctp/chunk.c index 158701d..a338091 100644 --- a/net/sctp/chunk.c +++ b/net/sctp/chunk.c @@ -164,7 +164,7 @@ static void sctp_datamsg_assign(struct sctp_datamsg *msg, struct sctp_chunk *chu */ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, struct sctp_sndrcvinfo *sinfo, - struct msghdr *msgh, int msg_len) + struct iov_iter *from) { int max, whole, i, offset, over, err; int len, first_len; @@ -172,6 +172,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, struct sctp_chunk *chunk; struct sctp_datamsg *msg; struct list_head *pos, *temp; + size_t msg_len = iov_iter_count(from); __u8 frag; msg = sctp_datamsg_new(GFP_KERNEL); @@ -279,12 +280,10 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, goto errout; } - err = sctp_user_addto_chunk(chunk, offset, len, msgh->msg_iov); + err = sctp_user_addto_chunk(chunk, len, from); if (err < 0) goto errout_chunk_free; - offset += len; - /* Put the chunk->skb back into the form expected by send. */ __skb_pull(chunk->skb, (__u8 *)chunk->chunk_hdr - (__u8 *)chunk->skb->data); @@ -317,7 +316,7 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, goto errout; } - err = sctp_user_addto_chunk(chunk, offset, over, msgh->msg_iov); + err = sctp_user_addto_chunk(chunk, over, from); /* Put the chunk->skb back into the form expected by send. */ __skb_pull(chunk->skb, (__u8 *)chunk->chunk_hdr |