diff options
author | David S. Miller <davem@davemloft.net> | 2014-11-05 16:46:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-05 16:46:40 -0500 |
commit | 51f3d02b980a338cd291d2bc7629cdfb2568424b (patch) | |
tree | f49898ea87db3d5e3f5c248ab21f6ed0a70785b8 /net/ipv4/tcp.c | |
parent | 1d76c1d028975df8488d1ae18a76f268eb5efa93 (diff) |
net: Add and use skb_copy_datagram_msg() helper.
This encapsulates all of the skb_copy_datagram_iovec() callers
with call argument signature "skb, offset, msghdr->msg_iov, length".
When we move to iov_iters in the networking, the iov_iter object will
sit in the msghdr.
Having a helper like this means there will be less places to touch
during that transformation.
Based upon descriptions and patch from Al Viro.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 39ec0c379545..c239f4740d10 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -1377,7 +1377,7 @@ static int tcp_peek_sndq(struct sock *sk, struct msghdr *msg, int len) | |||
1377 | /* XXX -- need to support SO_PEEK_OFF */ | 1377 | /* XXX -- need to support SO_PEEK_OFF */ |
1378 | 1378 | ||
1379 | skb_queue_walk(&sk->sk_write_queue, skb) { | 1379 | skb_queue_walk(&sk->sk_write_queue, skb) { |
1380 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, skb->len); | 1380 | err = skb_copy_datagram_msg(skb, 0, msg, skb->len); |
1381 | if (err) | 1381 | if (err) |
1382 | break; | 1382 | break; |
1383 | 1383 | ||
@@ -1833,8 +1833,7 @@ do_prequeue: | |||
1833 | } | 1833 | } |
1834 | 1834 | ||
1835 | if (!(flags & MSG_TRUNC)) { | 1835 | if (!(flags & MSG_TRUNC)) { |
1836 | err = skb_copy_datagram_iovec(skb, offset, | 1836 | err = skb_copy_datagram_msg(skb, offset, msg, used); |
1837 | msg->msg_iov, used); | ||
1838 | if (err) { | 1837 | if (err) { |
1839 | /* Exception. Bailout! */ | 1838 | /* Exception. Bailout! */ |
1840 | if (!copied) | 1839 | if (!copied) |