Commit 51f3d02b authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parent 1d76c1d0
...@@ -163,7 +163,7 @@ mISDN_sock_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -163,7 +163,7 @@ mISDN_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
memcpy(skb_push(skb, MISDN_HEADER_LEN), mISDN_HEAD_P(skb), memcpy(skb_push(skb, MISDN_HEADER_LEN), mISDN_HEAD_P(skb),
MISDN_HEADER_LEN); MISDN_HEADER_LEN);
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
mISDN_sock_cmsg(sk, msg, skb); mISDN_sock_cmsg(sk, msg, skb);
......
...@@ -981,7 +981,7 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -981,7 +981,7 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
if (skb) { if (skb) {
total_len = min_t(size_t, total_len, skb->len); total_len = min_t(size_t, total_len, skb->len);
error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len); error = skb_copy_datagram_msg(skb, 0, m, total_len);
if (error == 0) { if (error == 0) {
consume_skb(skb); consume_skb(skb);
return total_len; return total_len;
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/bug.h> #include <linux/bug.h>
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include <linux/socket.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <asm/types.h> #include <asm/types.h>
...@@ -2639,6 +2640,11 @@ unsigned int datagram_poll(struct file *file, struct socket *sock, ...@@ -2639,6 +2640,11 @@ unsigned int datagram_poll(struct file *file, struct socket *sock,
struct poll_table_struct *wait); struct poll_table_struct *wait);
int skb_copy_datagram_iovec(const struct sk_buff *from, int offset, int skb_copy_datagram_iovec(const struct sk_buff *from, int offset,
struct iovec *to, int size); struct iovec *to, int size);
static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset,
struct msghdr *msg, int size)
{
return skb_copy_datagram_iovec(from, offset, msg->msg_iov, size);
}
int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, int hlen, int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, int hlen,
struct iovec *iov); struct iovec *iov);
int skb_copy_datagram_from_iovec(struct sk_buff *skb, int offset, int skb_copy_datagram_from_iovec(struct sk_buff *skb, int offset,
......
...@@ -1758,7 +1758,7 @@ static int atalk_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr ...@@ -1758,7 +1758,7 @@ static int atalk_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr
copied = size; copied = size;
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
} }
err = skb_copy_datagram_iovec(skb, offset, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, offset, msg, copied);
if (!err && msg->msg_name) { if (!err && msg->msg_name) {
DECLARE_SOCKADDR(struct sockaddr_at *, sat, msg->msg_name); DECLARE_SOCKADDR(struct sockaddr_at *, sat, msg->msg_name);
......
...@@ -554,7 +554,7 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, ...@@ -554,7 +554,7 @@ int vcc_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
} }
error = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); error = skb_copy_datagram_msg(skb, 0, msg, copied);
if (error) if (error)
return error; return error;
sock_recv_ts_and_drops(msg, sk, skb); sock_recv_ts_and_drops(msg, sk, skb);
......
...@@ -1634,7 +1634,7 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -1634,7 +1634,7 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock,
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
} }
skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); skb_copy_datagram_msg(skb, 0, msg, copied);
if (msg->msg_name) { if (msg->msg_name) {
ax25_digi digi; ax25_digi digi;
......
...@@ -237,7 +237,7 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -237,7 +237,7 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
} }
skb_reset_transport_header(skb); skb_reset_transport_header(skb);
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err == 0) { if (err == 0) {
sock_recv_ts_and_drops(msg, sk, skb); sock_recv_ts_and_drops(msg, sk, skb);
...@@ -328,7 +328,7 @@ int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -328,7 +328,7 @@ int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
} }
chunk = min_t(unsigned int, skb->len, size); chunk = min_t(unsigned int, skb->len, size);
if (skb_copy_datagram_iovec(skb, 0, msg->msg_iov, chunk)) { if (skb_copy_datagram_msg(skb, 0, msg, chunk)) {
skb_queue_head(&sk->sk_receive_queue, skb); skb_queue_head(&sk->sk_receive_queue, skb);
if (!copied) if (!copied)
copied = -EFAULT; copied = -EFAULT;
......
...@@ -878,7 +878,7 @@ static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -878,7 +878,7 @@ static int hci_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
} }
skb_reset_transport_header(skb); skb_reset_transport_header(skb);
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
switch (hci_pi(sk)->channel) { switch (hci_pi(sk)->channel) {
case HCI_CHANNEL_RAW: case HCI_CHANNEL_RAW:
......
...@@ -293,7 +293,7 @@ static int caif_seqpkt_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -293,7 +293,7 @@ static int caif_seqpkt_recvmsg(struct kiocb *iocb, struct socket *sock,
copylen = len; copylen = len;
} }
ret = skb_copy_datagram_iovec(skb, 0, m->msg_iov, copylen); ret = skb_copy_datagram_msg(skb, 0, m, copylen);
if (ret) if (ret)
goto out_free; goto out_free;
......
...@@ -2457,7 +2457,7 @@ int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len, ...@@ -2457,7 +2457,7 @@ int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
copied = len; copied = len;
} }
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err) if (err)
goto out_free_skb; goto out_free_skb;
......
...@@ -896,7 +896,7 @@ verify_sock_status: ...@@ -896,7 +896,7 @@ verify_sock_status:
else if (len < skb->len) else if (len < skb->len)
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
if (skb_copy_datagram_iovec(skb, 0, msg->msg_iov, len)) { if (skb_copy_datagram_msg(skb, 0, msg, len)) {
/* Exception. Bailout! */ /* Exception. Bailout! */
len = -EFAULT; len = -EFAULT;
break; break;
......
...@@ -324,7 +324,7 @@ static int dgram_recvmsg(struct kiocb *iocb, struct sock *sk, ...@@ -324,7 +324,7 @@ static int dgram_recvmsg(struct kiocb *iocb, struct sock *sk,
} }
/* FIXME: skip headers if necessary ?! */ /* FIXME: skip headers if necessary ?! */
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err) if (err)
goto done; goto done;
......
...@@ -195,7 +195,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -195,7 +195,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
copied = len; copied = len;
} }
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err) if (err)
goto done; goto done;
......
...@@ -424,7 +424,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) ...@@ -424,7 +424,7 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
copied = len; copied = len;
} }
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err) if (err)
goto out_free_skb; goto out_free_skb;
......
...@@ -875,7 +875,7 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -875,7 +875,7 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
} }
/* Don't bother checking the checksum */ /* Don't bother checking the checksum */
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err) if (err)
goto done; goto done;
......
...@@ -718,7 +718,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, ...@@ -718,7 +718,7 @@ static int raw_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
copied = len; copied = len;
} }
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err) if (err)
goto done; goto done;
......
...@@ -1377,7 +1377,7 @@ static int tcp_peek_sndq(struct sock *sk, struct msghdr *msg, int len) ...@@ -1377,7 +1377,7 @@ static int tcp_peek_sndq(struct sock *sk, struct msghdr *msg, int len)
/* XXX -- need to support SO_PEEK_OFF */ /* XXX -- need to support SO_PEEK_OFF */
skb_queue_walk(&sk->sk_write_queue, skb) { skb_queue_walk(&sk->sk_write_queue, skb) {
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, skb->len); err = skb_copy_datagram_msg(skb, 0, msg, skb->len);
if (err) if (err)
break; break;
...@@ -1833,8 +1833,7 @@ do_prequeue: ...@@ -1833,8 +1833,7 @@ do_prequeue:
} }
if (!(flags & MSG_TRUNC)) { if (!(flags & MSG_TRUNC)) {
err = skb_copy_datagram_iovec(skb, offset, err = skb_copy_datagram_msg(skb, offset, msg, used);
msg->msg_iov, used);
if (err) { if (err) {
/* Exception. Bailout! */ /* Exception. Bailout! */
if (!copied) if (!copied)
......
...@@ -1281,8 +1281,8 @@ try_again: ...@@ -1281,8 +1281,8 @@ try_again:
} }
if (skb_csum_unnecessary(skb)) if (skb_csum_unnecessary(skb))
err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), err = skb_copy_datagram_msg(skb, sizeof(struct udphdr),
msg->msg_iov, copied); msg, copied);
else { else {
err = skb_copy_and_csum_datagram_iovec(skb, err = skb_copy_and_csum_datagram_iovec(skb,
sizeof(struct udphdr), sizeof(struct udphdr),
......
...@@ -351,7 +351,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) ...@@ -351,7 +351,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
copied = len; copied = len;
} }
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err) if (err)
goto out_free_skb; goto out_free_skb;
...@@ -445,7 +445,7 @@ int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len, ...@@ -445,7 +445,7 @@ int ipv6_recv_rxpmtu(struct sock *sk, struct msghdr *msg, int len,
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
copied = len; copied = len;
} }
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err) if (err)
goto out_free_skb; goto out_free_skb;
......
...@@ -486,11 +486,11 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk, ...@@ -486,11 +486,11 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
} }
if (skb_csum_unnecessary(skb)) { if (skb_csum_unnecessary(skb)) {
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
} else if (msg->msg_flags&MSG_TRUNC) { } else if (msg->msg_flags&MSG_TRUNC) {
if (__skb_checksum_complete(skb)) if (__skb_checksum_complete(skb))
goto csum_copy_err; goto csum_copy_err;
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
} else { } else {
err = skb_copy_and_csum_datagram_iovec(skb, 0, msg->msg_iov); err = skb_copy_and_csum_datagram_iovec(skb, 0, msg->msg_iov);
if (err == -EINVAL) if (err == -EINVAL)
......
...@@ -424,8 +424,8 @@ try_again: ...@@ -424,8 +424,8 @@ try_again:
} }
if (skb_csum_unnecessary(skb)) if (skb_csum_unnecessary(skb))
err = skb_copy_datagram_iovec(skb, sizeof(struct udphdr), err = skb_copy_datagram_msg(skb, sizeof(struct udphdr),
msg->msg_iov, copied); msg, copied);
else { else {
err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov); err = skb_copy_and_csum_datagram_iovec(skb, sizeof(struct udphdr), msg->msg_iov);
if (err == -EINVAL) if (err == -EINVAL)
......
...@@ -1805,8 +1805,7 @@ static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -1805,8 +1805,7 @@ static int ipx_recvmsg(struct kiocb *iocb, struct socket *sock,
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
} }
rc = skb_copy_datagram_iovec(skb, sizeof(struct ipxhdr), msg->msg_iov, rc = skb_copy_datagram_msg(skb, sizeof(struct ipxhdr), msg, copied);
copied);
if (rc) if (rc)
goto out_free; goto out_free;
if (skb->tstamp.tv64) if (skb->tstamp.tv64)
......
...@@ -1396,7 +1396,7 @@ static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock, ...@@ -1396,7 +1396,7 @@ static int irda_recvmsg_dgram(struct kiocb *iocb, struct socket *sock,
copied = size; copied = size;
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
} }
skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); skb_copy_datagram_msg(skb, 0, msg, copied);
skb_free_datagram(sk, skb); skb_free_datagram(sk, skb);
......
...@@ -1355,7 +1355,7 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -1355,7 +1355,7 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
sk->sk_shutdown = sk->sk_shutdown | RCV_SHUTDOWN; sk->sk_shutdown = sk->sk_shutdown | RCV_SHUTDOWN;
cskb = skb; cskb = skb;
if (skb_copy_datagram_iovec(cskb, offset, msg->msg_iov, copied)) { if (skb_copy_datagram_msg(cskb, offset, msg, copied)) {
if (!(flags & MSG_PEEK)) if (!(flags & MSG_PEEK))
skb_queue_head(&sk->sk_receive_queue, skb); skb_queue_head(&sk->sk_receive_queue, skb);
return -EFAULT; return -EFAULT;
......
...@@ -3654,7 +3654,7 @@ static int pfkey_recvmsg(struct kiocb *kiocb, ...@@ -3654,7 +3654,7 @@ static int pfkey_recvmsg(struct kiocb *kiocb,
} }
skb_reset_transport_header(skb); skb_reset_transport_header(skb);
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err) if (err)
goto out_free; goto out_free;
......
...@@ -528,7 +528,7 @@ static int l2tp_ip_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m ...@@ -528,7 +528,7 @@ static int l2tp_ip_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
copied = len; copied = len;
} }
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err) if (err)
goto done; goto done;
......
...@@ -672,7 +672,7 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk, ...@@ -672,7 +672,7 @@ static int l2tp_ip6_recvmsg(struct kiocb *iocb, struct sock *sk,
copied = len; copied = len;
} }
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err) if (err)
goto done; goto done;
......
...@@ -208,7 +208,7 @@ static int pppol2tp_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -208,7 +208,7 @@ static int pppol2tp_recvmsg(struct kiocb *iocb, struct socket *sock,
else if (len < skb->len) else if (len < skb->len)
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, len); err = skb_copy_datagram_msg(skb, 0, msg, len);
if (likely(err == 0)) if (likely(err == 0))
err = len; err = len;
......
...@@ -819,8 +819,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -819,8 +819,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
used = len; used = len;
if (!(flags & MSG_TRUNC)) { if (!(flags & MSG_TRUNC)) {
int rc = skb_copy_datagram_iovec(skb, offset, int rc = skb_copy_datagram_msg(skb, offset, msg, used);
msg->msg_iov, used);
if (rc) { if (rc) {
/* Exception. Bailout! */ /* Exception. Bailout! */
if (!copied) if (!copied)
......
...@@ -2401,7 +2401,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock, ...@@ -2401,7 +2401,7 @@ static int netlink_recvmsg(struct kiocb *kiocb, struct socket *sock,
} }
skb_reset_transport_header(data_skb); skb_reset_transport_header(data_skb);
err = skb_copy_datagram_iovec(data_skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(data_skb, 0, msg, copied);
if (msg->msg_name) { if (msg->msg_name) {
DECLARE_SOCKADDR(struct sockaddr_nl *, addr, msg->msg_name); DECLARE_SOCKADDR(struct sockaddr_nl *, addr, msg->msg_name);
......
...@@ -1167,7 +1167,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -1167,7 +1167,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
} }
er = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); er = skb_copy_datagram_msg(skb, 0, msg, copied);
if (er < 0) { if (er < 0) {
skb_free_datagram(sk, skb); skb_free_datagram(sk, skb);
release_sock(sk); release_sock(sk);
......
...@@ -832,7 +832,7 @@ static int llcp_sock_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -832,7 +832,7 @@ static int llcp_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
copied = min_t(unsigned int, rlen, len); copied = min_t(unsigned int, rlen, len);
cskb = skb; cskb = skb;
if (skb_copy_datagram_iovec(cskb, 0, msg->msg_iov, copied)) { if (skb_copy_datagram_msg(cskb, 0, msg, copied)) {
if (!(flags & MSG_PEEK)) if (!(flags & MSG_PEEK))
skb_queue_head(&sk->sk_receive_queue, skb); skb_queue_head(&sk->sk_receive_queue, skb);
return -EFAULT; return -EFAULT;
......
...@@ -269,7 +269,7 @@ static int rawsock_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -269,7 +269,7 @@ static int rawsock_recvmsg(struct kiocb *iocb, struct socket *sock,
copied = len; copied = len;
} }
rc = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); rc = skb_copy_datagram_msg(skb, 0, msg, copied);
skb_free_datagram(sk, skb); skb_free_datagram(sk, skb);
......
...@@ -2953,7 +2953,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -2953,7 +2953,7 @@ static int packet_recvmsg(struct kiocb *iocb, struct socket *sock,
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
} }
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); err = skb_copy_datagram_msg(skb, 0, msg, copied);
if (err) if (err)
goto out_free; goto out_free;
......
...@@ -150,7 +150,7 @@ static int pn_recvmsg(struct kiocb *iocb, struct sock *sk, ...@@ -150,7 +150,7 @@ static int pn_recvmsg(struct kiocb *iocb, struct sock *sk,
copylen = len; copylen = len;
} }
rval = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copylen); rval = skb_copy_datagram_msg(skb, 0, msg, copylen);
if (rval) { if (rval) {
rval = -EFAULT; rval = -EFAULT;
goto out; goto out;
......
...@@ -1296,7 +1296,7 @@ copy: ...@@ -1296,7 +1296,7 @@ copy:
else else
len = skb->len; len = skb->len;
err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, len); err = skb_copy_datagram_msg(skb, 0, msg, len);
if (!err) if (!err)
err = (flags & MSG_TRUNC) ? skb->len : len; err = (flags & MSG_TRUNC) ? skb->len : len;
......
...@@ -1249,7 +1249,7 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock, ...@@ -1249,7 +1249,7 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock,
msg->msg_flags |= MSG_TRUNC; msg->msg_flags |= MSG_TRUNC;
} }
skb_copy_datagram_iovec(skb, 0, msg->msg_iov, copied); skb_copy_datagram_msg(skb, 0, msg, copied);
if (msg->msg_name) { if (msg->msg_name) {