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 | |
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')
40 files changed, 50 insertions, 55 deletions
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index c00897f65a31..425942db17f6 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c | |||
@@ -1758,7 +1758,7 @@ static int atalk_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr | |||
1758 | copied = size; | 1758 | copied = size; |
1759 | msg->msg_flags |= MSG_TRUNC; | 1759 | msg->msg_flags |= MSG_TRUNC; |
1760 | } | 1760 | } |
1761 | err = skb_copy_datagram_iovec(skb, offset, msg->msg_iov, copied); | 1761 | err = skb_copy_datagram_msg(skb, offset, msg, copied); |
1762 | 1762 | ||
1763 | if (!err && msg->msg_name) { | 1763 | if (!err && msg->msg_name) { |
1764 | DECLARE_SOCKADDR(struct sockaddr_at *, sat, msg->msg_name); | 1764 | DECLARE_SOCKADDR(struct sockaddr_at *, sat, msg->msg_name); |
diff --git a/net/atm/common.c b/net/atm/common.c index 6a765156a3f6..9cd1ccae9a11 100644 --- a/net/atm/common.c +++ b/net/atm/common.c | |||
@@ -554,7 +554,7 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, | |||
554 | msg->msg_flags |= MSG_TRUNC; | 554 | msg->msg_flags |= MSG_TRUNC; |
555 | } | 555 | } |
556 | 556 | ||
557 | error = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 557 | error = skb_copy_datagram_msg(skb, 0, msg, copied); |
558 | if (error) | 558 | if (error) |
559 | return error; | 559 | return error; |
560 | sock_recv_ts_and_drops(msg, sk, skb); | 560 | sock_recv_ts_and_drops(msg, sk, skb); |
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index c35c3f48fc0f..f4f835e19378 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
@@ -1634,7 +1634,7 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1634 | msg->msg_flags |= MSG_TRUNC; | 1634 | msg->msg_flags |= MSG_TRUNC; |
1635 | } | 1635 | } |
1636 | 1636 | ||
1637 | skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 1637 | skb_copy_datagram_msg(skb, 0, msg, copied); |
1638 | 1638 | ||
1639 | if (msg->msg_name) { | 1639 | if (msg->msg_name) { |
1640 | ax25_digi digi; | 1640 | ax25_digi digi; |
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 339c74ad4553..0a7cc565f93e 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
@@ -237,7 +237,7 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
237 | } | 237 | } |
238 | 238 | ||
239 | skb_reset_transport_header(skb); | 239 | skb_reset_transport_header(skb); |
240 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 240 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
241 | if (err == 0) { | 241 | if (err == 0) { |
242 | sock_recv_ts_and_drops(msg, sk, skb); | 242 | sock_recv_ts_and_drops(msg, sk, skb); |
243 | 243 | ||
@@ -328,7 +328,7 @@ int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
328 | } | 328 | } |
329 | 329 | ||
330 | chunk = min_t(unsigned int, skb->len, size); | 330 | chunk = min_t(unsigned int, skb->len, size); |
331 | if (skb_copy_datagram_iovec(skb, 0, msg->msg_iov, chunk)) { | 331 | if (skb_copy_datagram_msg(skb, 0, msg, chunk)) { |
332 | skb_queue_head(&sk->sk_receive_queue, skb); | 332 | skb_queue_head(&sk->sk_receive_queue, skb); |
333 | if (!copied) | 333 | if (!copied) |
334 | copied = -EFAULT; | 334 | copied = -EFAULT; |
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 115f149362ba..29e1ec7189bd 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -878,7 +878,7 @@ static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
878 | } | 878 | } |
879 | 879 | ||
880 | skb_reset_transport_header(skb); | 880 | skb_reset_transport_header(skb); |
881 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 881 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
882 | 882 | ||
883 | switch (hci_pi(sk)->channel) { | 883 | switch (hci_pi(sk)->channel) { |
884 | case HCI_CHANNEL_RAW: | 884 | case HCI_CHANNEL_RAW: |
diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c index 43f750e88e19..fbcd156099fb 100644 --- a/net/caif/caif_socket.c +++ b/net/caif/caif_socket.c | |||
@@ -293,7 +293,7 @@ static int caif_seqpkt_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
293 | copylen = len; | 293 | copylen = len; |
294 | } | 294 | } |
295 | 295 | ||
296 | ret = skb_copy_datagram_iovec(skb, 0, m->msg_iov, copylen); | 296 | ret = skb_copy_datagram_msg(skb, 0, m, copylen); |
297 | if (ret) | 297 | if (ret) |
298 | goto out_free; | 298 | goto out_free; |
299 | 299 | ||
diff --git a/net/core/sock.c b/net/core/sock.c index 15e0c67b1069..ac56dd06c306 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -2457,7 +2457,7 @@ int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len, | |||
2457 | msg->msg_flags |= MSG_TRUNC; | 2457 | msg->msg_flags |= MSG_TRUNC; |
2458 | copied = len; | 2458 | copied = len; |
2459 | } | 2459 | } |
2460 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 2460 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
2461 | if (err) | 2461 | if (err) |
2462 | goto out_free_skb; | 2462 | goto out_free_skb; |
2463 | 2463 | ||
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 5ab6627cf370..8e6ae9422a7b 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -896,7 +896,7 @@ verify_sock_status: | |||
896 | else if (len < skb->len) | 896 | else if (len < skb->len) |
897 | msg->msg_flags |= MSG_TRUNC; | 897 | msg->msg_flags |= MSG_TRUNC; |
898 | 898 | ||
899 | if (skb_copy_datagram_iovec(skb, 0, msg->msg_iov, len)) { | 899 | if (skb_copy_datagram_msg(skb, 0, msg, len)) { |
900 | /* Exception. Bailout! */ | 900 | /* Exception. Bailout! */ |
901 | len = -EFAULT; | 901 | len = -EFAULT; |
902 | break; | 902 | break; |
diff --git a/net/ieee802154/dgram.c b/net/ieee802154/dgram.c index ef2ad8aaef13..fc9193eabd41 100644 --- a/net/ieee802154/dgram.c +++ b/net/ieee802154/dgram.c | |||
@@ -324,7 +324,7 @@ static int dgram_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
324 | } | 324 | } |
325 | 325 | ||
326 | /* FIXME: skip headers if necessary ?! */ | 326 | /* FIXME: skip headers if necessary ?! */ |
327 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 327 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
328 | if (err) | 328 | if (err) |
329 | goto done; | 329 | goto done; |
330 | 330 | ||
diff --git a/net/ieee802154/raw.c b/net/ieee802154/raw.c index 9d1f64806f02..73a4d53463de 100644 --- a/net/ieee802154/raw.c +++ b/net/ieee802154/raw.c | |||
@@ -195,7 +195,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
195 | copied = len; | 195 | copied = len; |
196 | } | 196 | } |
197 | 197 | ||
198 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 198 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
199 | if (err) | 199 | if (err) |
200 | goto done; | 200 | goto done; |
201 | 201 | ||
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index c373a9ad4555..21894df66262 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -424,7 +424,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) | |||
424 | msg->msg_flags |= MSG_TRUNC; | 424 | msg->msg_flags |= MSG_TRUNC; |
425 | copied = len; | 425 | copied = len; |
426 | } | 426 | } |
427 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 427 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
428 | if (err) | 428 | if (err) |
429 | goto out_free_skb; | 429 | goto out_free_skb; |
430 | 430 | ||
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 57f7c9804139..736236c3e554 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c | |||
@@ -875,7 +875,7 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
875 | } | 875 | } |
876 | 876 | ||
877 | /* Don't bother checking the checksum */ | 877 | /* Don't bother checking the checksum */ |
878 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 878 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
879 | if (err) | 879 | if (err) |
880 | goto done; | 880 | goto done; |
881 | 881 | ||
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 739db3100c23..ee8fa4bf3b73 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -718,7 +718,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
718 | copied = len; | 718 | copied = len; |
719 | } | 719 | } |
720 | 720 | ||
721 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 721 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
722 | if (err) | 722 | if (err) |
723 | goto done; | 723 | goto done; |
724 | 724 | ||
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) |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 3f001db72351..df19027f44f3 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1281,8 +1281,8 @@ try_again: | |||
1281 | } | 1281 | } |
1282 | 1282 | ||
1283 | if (skb_csum_unnecessary(skb)) | 1283 | if (skb_csum_unnecessary(skb)) |
1284 | err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), | 1284 | err = skb_copy_datagram_msg(skb, sizeof(struct udphdr), |
1285 | msg->msg_iov, copied); | 1285 | msg, copied); |
1286 | else { | 1286 | else { |
1287 | err = skb_copy_and_csum_datagram_iovec(skb, | 1287 | err = skb_copy_and_csum_datagram_iovec(skb, |
1288 | sizeof(struct udphdr), | 1288 | sizeof(struct udphdr), |
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index 2cdc38338be3..5c6996e44b14 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c | |||
@@ -351,7 +351,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) | |||
351 | msg->msg_flags |= MSG_TRUNC; | 351 | msg->msg_flags |= MSG_TRUNC; |
352 | copied = len; | 352 | copied = len; |
353 | } | 353 | } |
354 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 354 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
355 | if (err) | 355 | if (err) |
356 | goto out_free_skb; | 356 | goto out_free_skb; |
357 | 357 | ||
@@ -445,7 +445,7 @@ int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len, | |||
445 | msg->msg_flags |= MSG_TRUNC; | 445 | msg->msg_flags |= MSG_TRUNC; |
446 | copied = len; | 446 | copied = len; |
447 | } | 447 | } |
448 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 448 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
449 | if (err) | 449 | if (err) |
450 | goto out_free_skb; | 450 | goto out_free_skb; |
451 | 451 | ||
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c index 075a0fb400e7..0cbcf98f2cab 100644 --- a/net/ipv6/raw.c +++ b/net/ipv6/raw.c | |||
@@ -486,11 +486,11 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
486 | } | 486 | } |
487 | 487 | ||
488 | if (skb_csum_unnecessary(skb)) { | 488 | if (skb_csum_unnecessary(skb)) { |
489 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 489 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
490 | } else if (msg->msg_flags&MSG_TRUNC) { | 490 | } else if (msg->msg_flags&MSG_TRUNC) { |
491 | if (__skb_checksum_complete(skb)) | 491 | if (__skb_checksum_complete(skb)) |
492 | goto csum_copy_err; | 492 | goto csum_copy_err; |
493 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 493 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
494 | } else { | 494 | } else { |
495 | err = skb_copy_and_csum_datagram_iovec(skb, 0, msg->msg_iov); | 495 | err = skb_copy_and_csum_datagram_iovec(skb, 0, msg->msg_iov); |
496 | if (err == -EINVAL) | 496 | if (err == -EINVAL) |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index f6ba535b6feb..9b6809232b17 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -424,8 +424,8 @@ try_again: | |||
424 | } | 424 | } |
425 | 425 | ||
426 | if (skb_csum_unnecessary(skb)) | 426 | if (skb_csum_unnecessary(skb)) |
427 | err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), | 427 | err = skb_copy_datagram_msg(skb, sizeof(struct udphdr), |
428 | msg->msg_iov, copied); | 428 | msg, copied); |
429 | else { | 429 | else { |
430 | err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov); | 430 | err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov); |
431 | if (err == -EINVAL) | 431 | if (err == -EINVAL) |
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index 313ef4644069..a0c75366c93b 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c | |||
@@ -1805,8 +1805,7 @@ static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1805 | msg->msg_flags |= MSG_TRUNC; | 1805 | msg->msg_flags |= MSG_TRUNC; |
1806 | } | 1806 | } |
1807 | 1807 | ||
1808 | rc = skb_copy_datagram_iovec(skb, sizeof(struct ipxhdr), msg->msg_iov, | 1808 | rc = skb_copy_datagram_msg(skb, sizeof(struct ipxhdr), msg, copied); |
1809 | copied); | ||
1810 | if (rc) | 1809 | if (rc) |
1811 | goto out_free; | 1810 | goto out_free; |
1812 | if (skb->tstamp.tv64) | 1811 | if (skb->tstamp.tv64) |
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 92fafd485deb..980bc2670a13 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
@@ -1396,7 +1396,7 @@ static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock, | |||
1396 | copied = size; | 1396 | copied = size; |
1397 | msg->msg_flags |= MSG_TRUNC; | 1397 | msg->msg_flags |= MSG_TRUNC; |
1398 | } | 1398 | } |
1399 | skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 1399 | skb_copy_datagram_msg(skb, 0, msg, copied); |
1400 | 1400 | ||
1401 | skb_free_datagram(sk, skb); | 1401 | skb_free_datagram(sk, skb); |
1402 | 1402 | ||
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c index a089b6b91650..057b5647ef92 100644 --- a/net/iucv/af_iucv.c +++ b/net/iucv/af_iucv.c | |||
@@ -1355,7 +1355,7 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1355 | sk->sk_shutdown = sk->sk_shutdown | RCV_SHUTDOWN; | 1355 | sk->sk_shutdown = sk->sk_shutdown | RCV_SHUTDOWN; |
1356 | 1356 | ||
1357 | cskb = skb; | 1357 | cskb = skb; |
1358 | if (skb_copy_datagram_iovec(cskb, offset, msg->msg_iov, copied)) { | 1358 | if (skb_copy_datagram_msg(cskb, offset, msg, copied)) { |
1359 | if (!(flags & MSG_PEEK)) | 1359 | if (!(flags & MSG_PEEK)) |
1360 | skb_queue_head(&sk->sk_receive_queue, skb); | 1360 | skb_queue_head(&sk->sk_receive_queue, skb); |
1361 | return -EFAULT; | 1361 | return -EFAULT; |
diff --git a/net/key/af_key.c b/net/key/af_key.c index 1847ec4e3930..e5883091a8c6 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -3654,7 +3654,7 @@ static int pfkey_recvmsg(struct kiocb *kiocb, | |||
3654 | } | 3654 | } |
3655 | 3655 | ||
3656 | skb_reset_transport_header(skb); | 3656 | skb_reset_transport_header(skb); |
3657 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 3657 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
3658 | if (err) | 3658 | if (err) |
3659 | goto out_free; | 3659 | goto out_free; |
3660 | 3660 | ||
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index 369a9822488c..a6cc1fed2b52 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c | |||
@@ -528,7 +528,7 @@ static int l2tp_ip_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m | |||
528 | copied = len; | 528 | copied = len; |
529 | } | 529 | } |
530 | 530 | ||
531 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 531 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
532 | if (err) | 532 | if (err) |
533 | goto done; | 533 | goto done; |
534 | 534 | ||
diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c index 0edb263cc002..2177b960da87 100644 --- a/net/l2tp/l2tp_ip6.c +++ b/net/l2tp/l2tp_ip6.c | |||
@@ -672,7 +672,7 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
672 | copied = len; | 672 | copied = len; |
673 | } | 673 | } |
674 | 674 | ||
675 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 675 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
676 | if (err) | 676 | if (err) |
677 | goto done; | 677 | goto done; |
678 | 678 | ||
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c index b704a9356208..c559bcdf4679 100644 --- a/net/l2tp/l2tp_ppp.c +++ b/net/l2tp/l2tp_ppp.c | |||
@@ -208,7 +208,7 @@ static int pppol2tp_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
208 | else if (len < skb->len) | 208 | else if (len < skb->len) |
209 | msg->msg_flags |= MSG_TRUNC; | 209 | msg->msg_flags |= MSG_TRUNC; |
210 | 210 | ||
211 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, len); | 211 | err = skb_copy_datagram_msg(skb, 0, msg, len); |
212 | if (likely(err == 0)) | 212 | if (likely(err == 0)) |
213 | err = len; | 213 | err = len; |
214 | 214 | ||
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index bb9cbc17d926..af662669f951 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
@@ -819,8 +819,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
819 | used = len; | 819 | used = len; |
820 | 820 | ||
821 | if (!(flags & MSG_TRUNC)) { | 821 | if (!(flags & MSG_TRUNC)) { |
822 | int rc = skb_copy_datagram_iovec(skb, offset, | 822 | int rc = skb_copy_datagram_msg(skb, offset, msg, used); |
823 | msg->msg_iov, used); | ||
824 | if (rc) { | 823 | if (rc) { |
825 | /* Exception. Bailout! */ | 824 | /* Exception. Bailout! */ |
826 | if (!copied) | 825 | if (!copied) |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index f1de72de273e..580b79452bec 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -2401,7 +2401,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock, | |||
2401 | } | 2401 | } |
2402 | 2402 | ||
2403 | skb_reset_transport_header(data_skb); | 2403 | skb_reset_transport_header(data_skb); |
2404 | err = skb_copy_datagram_iovec(data_skb, 0, msg->msg_iov, copied); | 2404 | err = skb_copy_datagram_msg(data_skb, 0, msg, copied); |
2405 | 2405 | ||
2406 | if (msg->msg_name) { | 2406 | if (msg->msg_name) { |
2407 | DECLARE_SOCKADDR(struct sockaddr_nl *, addr, msg->msg_name); | 2407 | DECLARE_SOCKADDR(struct sockaddr_nl *, addr, msg->msg_name); |
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 1b06a1fcf3e8..7e13f6afcd1f 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
@@ -1167,7 +1167,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1167 | msg->msg_flags |= MSG_TRUNC; | 1167 | msg->msg_flags |= MSG_TRUNC; |
1168 | } | 1168 | } |
1169 | 1169 | ||
1170 | er = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 1170 | er = skb_copy_datagram_msg(skb, 0, msg, copied); |
1171 | if (er < 0) { | 1171 | if (er < 0) { |
1172 | skb_free_datagram(sk, skb); | 1172 | skb_free_datagram(sk, skb); |
1173 | release_sock(sk); | 1173 | release_sock(sk); |
diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c index 51f077a92fa9..83bc785d5855 100644 --- a/net/nfc/llcp_sock.c +++ b/net/nfc/llcp_sock.c | |||
@@ -832,7 +832,7 @@ static int llcp_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
832 | copied = min_t(unsigned int, rlen, len); | 832 | copied = min_t(unsigned int, rlen, len); |
833 | 833 | ||
834 | cskb = skb; | 834 | cskb = skb; |
835 | if (skb_copy_datagram_iovec(cskb, 0, msg->msg_iov, copied)) { | 835 | if (skb_copy_datagram_msg(cskb, 0, msg, copied)) { |
836 | if (!(flags & MSG_PEEK)) | 836 | if (!(flags & MSG_PEEK)) |
837 | skb_queue_head(&sk->sk_receive_queue, skb); | 837 | skb_queue_head(&sk->sk_receive_queue, skb); |
838 | return -EFAULT; | 838 | return -EFAULT; |
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c index 11c3544ea546..9d7d2b7ba5e4 100644 --- a/net/nfc/rawsock.c +++ b/net/nfc/rawsock.c | |||
@@ -269,7 +269,7 @@ static int rawsock_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
269 | copied = len; | 269 | copied = len; |
270 | } | 270 | } |
271 | 271 | ||
272 | rc = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 272 | rc = skb_copy_datagram_msg(skb, 0, msg, copied); |
273 | 273 | ||
274 | skb_free_datagram(sk, skb); | 274 | skb_free_datagram(sk, skb); |
275 | 275 | ||
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 87d20f48ff06..4cd13d8de44b 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -2953,7 +2953,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
2953 | msg->msg_flags |= MSG_TRUNC; | 2953 | msg->msg_flags |= MSG_TRUNC; |
2954 | } | 2954 | } |
2955 | 2955 | ||
2956 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 2956 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
2957 | if (err) | 2957 | if (err) |
2958 | goto out_free; | 2958 | goto out_free; |
2959 | 2959 | ||
diff --git a/net/phonet/datagram.c b/net/phonet/datagram.c index 290352c0e6b4..0918bc21eae6 100644 --- a/net/phonet/datagram.c +++ b/net/phonet/datagram.c | |||
@@ -150,7 +150,7 @@ static int pn_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
150 | copylen = len; | 150 | copylen = len; |
151 | } | 151 | } |
152 | 152 | ||
153 | rval = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copylen); | 153 | rval = skb_copy_datagram_msg(skb, 0, msg, copylen); |
154 | if (rval) { | 154 | if (rval) { |
155 | rval = -EFAULT; | 155 | rval = -EFAULT; |
156 | goto out; | 156 | goto out; |
diff --git a/net/phonet/pep.c b/net/phonet/pep.c index 70a547ea5177..44b2123e22b8 100644 --- a/net/phonet/pep.c +++ b/net/phonet/pep.c | |||
@@ -1296,7 +1296,7 @@ copy: | |||
1296 | else | 1296 | else |
1297 | len = skb->len; | 1297 | len = skb->len; |
1298 | 1298 | ||
1299 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, len); | 1299 | err = skb_copy_datagram_msg(skb, 0, msg, len); |
1300 | if (!err) | 1300 | if (!err) |
1301 | err = (flags & MSG_TRUNC) ? skb->len : len; | 1301 | err = (flags & MSG_TRUNC) ? skb->len : len; |
1302 | 1302 | ||
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index a85c1a086ae4..9b600c20a7a3 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -1249,7 +1249,7 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1249 | msg->msg_flags |= MSG_TRUNC; | 1249 | msg->msg_flags |= MSG_TRUNC; |
1250 | } | 1250 | } |
1251 | 1251 | ||
1252 | skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 1252 | skb_copy_datagram_msg(skb, 0, msg, copied); |
1253 | 1253 | ||
1254 | if (msg->msg_name) { | 1254 | if (msg->msg_name) { |
1255 | struct sockaddr_rose *srose; | 1255 | struct sockaddr_rose *srose; |
diff --git a/net/rxrpc/ar-recvmsg.c b/net/rxrpc/ar-recvmsg.c index e9aaa65c0778..4575485ad1b4 100644 --- a/net/rxrpc/ar-recvmsg.c +++ b/net/rxrpc/ar-recvmsg.c | |||
@@ -180,7 +180,7 @@ int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
180 | if (copy > len - copied) | 180 | if (copy > len - copied) |
181 | copy = len - copied; | 181 | copy = len - copied; |
182 | 182 | ||
183 | ret = skb_copy_datagram_iovec(skb, offset, msg->msg_iov, copy); | 183 | ret = skb_copy_datagram_msg(skb, offset, msg, copy); |
184 | 184 | ||
185 | if (ret < 0) | 185 | if (ret < 0) |
186 | goto copy_error; | 186 | goto copy_error; |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 634a2abb5f3a..2120292c842d 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -2095,7 +2095,7 @@ static int sctp_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
2095 | if (copied > len) | 2095 | if (copied > len) |
2096 | copied = len; | 2096 | copied = len; |
2097 | 2097 | ||
2098 | err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 2098 | err = skb_copy_datagram_msg(skb, 0, msg, copied); |
2099 | 2099 | ||
2100 | event = sctp_skb2event(skb); | 2100 | event = sctp_skb2event(skb); |
2101 | 2101 | ||
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index ad8a1a1e2275..591bbfa082a0 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -1372,8 +1372,7 @@ restart: | |||
1372 | sz = buf_len; | 1372 | sz = buf_len; |
1373 | m->msg_flags |= MSG_TRUNC; | 1373 | m->msg_flags |= MSG_TRUNC; |
1374 | } | 1374 | } |
1375 | res = skb_copy_datagram_iovec(buf, msg_hdr_sz(msg), | 1375 | res = skb_copy_datagram_msg(buf, msg_hdr_sz(msg), m, sz); |
1376 | m->msg_iov, sz); | ||
1377 | if (res) | 1376 | if (res) |
1378 | goto exit; | 1377 | goto exit; |
1379 | res = sz; | 1378 | res = sz; |
@@ -1473,8 +1472,8 @@ restart: | |||
1473 | needed = (buf_len - sz_copied); | 1472 | needed = (buf_len - sz_copied); |
1474 | sz_to_copy = (sz <= needed) ? sz : needed; | 1473 | sz_to_copy = (sz <= needed) ? sz : needed; |
1475 | 1474 | ||
1476 | res = skb_copy_datagram_iovec(buf, msg_hdr_sz(msg) + offset, | 1475 | res = skb_copy_datagram_msg(buf, msg_hdr_sz(msg) + offset, |
1477 | m->msg_iov, sz_to_copy); | 1476 | m, sz_to_copy); |
1478 | if (res) | 1477 | if (res) |
1479 | goto exit; | 1478 | goto exit; |
1480 | 1479 | ||
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index e96884380732..5eee625d113f 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -1825,7 +1825,7 @@ static int unix_dgram_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1825 | else if (size < skb->len - skip) | 1825 | else if (size < skb->len - skip) |
1826 | msg->msg_flags |= MSG_TRUNC; | 1826 | msg->msg_flags |= MSG_TRUNC; |
1827 | 1827 | ||
1828 | err = skb_copy_datagram_iovec(skb, skip, msg->msg_iov, size); | 1828 | err = skb_copy_datagram_msg(skb, skip, msg, size); |
1829 | if (err) | 1829 | if (err) |
1830 | goto out_free; | 1830 | goto out_free; |
1831 | 1831 | ||
@@ -2030,8 +2030,8 @@ again: | |||
2030 | } | 2030 | } |
2031 | 2031 | ||
2032 | chunk = min_t(unsigned int, unix_skb_len(skb) - skip, size); | 2032 | chunk = min_t(unsigned int, unix_skb_len(skb) - skip, size); |
2033 | if (skb_copy_datagram_iovec(skb, UNIXCB(skb).consumed + skip, | 2033 | if (skb_copy_datagram_msg(skb, UNIXCB(skb).consumed + skip, |
2034 | msg->msg_iov, chunk)) { | 2034 | msg, chunk)) { |
2035 | if (copied == 0) | 2035 | if (copied == 0) |
2036 | copied = -EFAULT; | 2036 | copied = -EFAULT; |
2037 | break; | 2037 | break; |
diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c index 9bb63ffec4f2..a57ddef7d5af 100644 --- a/net/vmw_vsock/vmci_transport.c +++ b/net/vmw_vsock/vmci_transport.c | |||
@@ -1773,8 +1773,7 @@ static int vmci_transport_dgram_dequeue(struct kiocb *kiocb, | |||
1773 | } | 1773 | } |
1774 | 1774 | ||
1775 | /* Place the datagram payload in the user's iovec. */ | 1775 | /* Place the datagram payload in the user's iovec. */ |
1776 | err = skb_copy_datagram_iovec(skb, sizeof(*dg), msg->msg_iov, | 1776 | err = skb_copy_datagram_msg(skb, sizeof(*dg), msg, payload_len); |
1777 | payload_len); | ||
1778 | if (err) | 1777 | if (err) |
1779 | goto out; | 1778 | goto out; |
1780 | 1779 | ||
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 5ad4418ef093..59e785bfde65 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
@@ -1335,7 +1335,7 @@ static int x25_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1335 | /* Currently, each datagram always contains a complete record */ | 1335 | /* Currently, each datagram always contains a complete record */ |
1336 | msg->msg_flags |= MSG_EOR; | 1336 | msg->msg_flags |= MSG_EOR; |
1337 | 1337 | ||
1338 | rc = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); | 1338 | rc = skb_copy_datagram_msg(skb, 0, msg, copied); |
1339 | if (rc) | 1339 | if (rc) |
1340 | goto out_free_dgram; | 1340 | goto out_free_dgram; |
1341 | 1341 | ||