aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-11-24 10:42:55 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2014-12-09 16:29:03 -0500
commitc0371da6047abd261bc483c744dbc7d81a116172 (patch)
tree73b4d685f311a83e04f3a684ce18225b409b3f5f /include
parentd838df2e5dcbb6ed4d82854869e9a30f9aeef6da (diff)
put iov_iter into msghdr
Note that the code _using_ ->msg_iter at that point will be very unhappy with anything other than unshifted iovec-backed iov_iter. We still need to convert users to proper primitives. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/skbuff.h16
-rw-r--r--include/linux/socket.h3
-rw-r--r--include/net/bluetooth/l2cap.h2
-rw-r--r--include/net/udplite.h3
4 files changed, 14 insertions, 10 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ef64cec42804..52cf1bdac0d8 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -2646,22 +2646,24 @@ unsigned int datagram_poll(struct file *file, struct socket *sock,
2646 struct poll_table_struct *wait); 2646 struct poll_table_struct *wait);
2647int skb_copy_datagram_iovec(const struct sk_buff *from, int offset, 2647int skb_copy_datagram_iovec(const struct sk_buff *from, int offset,
2648 struct iovec *to, int size); 2648 struct iovec *to, int size);
2649int skb_copy_datagram_iter(const struct sk_buff *from, int offset,
2650 struct iov_iter *to, int size);
2649static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset, 2651static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset,
2650 struct msghdr *msg, int size) 2652 struct msghdr *msg, int size)
2651{ 2653{
2652 return skb_copy_datagram_iovec(from, offset, msg->msg_iov, size); 2654 /* XXX: stripping const */
2655 return skb_copy_datagram_iovec(from, offset, (struct iovec *)msg->msg_iter.iov, size);
2653} 2656}
2654int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, int hlen, 2657int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, int hlen,
2655 struct iovec *iov); 2658 struct iovec *iov);
2656static inline int skb_copy_and_csum_datagram_msg(struct sk_buff *skb, int hlen, 2659static inline int skb_copy_and_csum_datagram_msg(struct sk_buff *skb, int hlen,
2657 struct msghdr *msg) 2660 struct msghdr *msg)
2658{ 2661{
2659 return skb_copy_and_csum_datagram_iovec(skb, hlen, msg->msg_iov); 2662 /* XXX: stripping const */
2663 return skb_copy_and_csum_datagram_iovec(skb, hlen, (struct iovec *)msg->msg_iter.iov);
2660} 2664}
2661int skb_copy_datagram_from_iter(struct sk_buff *skb, int offset, 2665int skb_copy_datagram_from_iter(struct sk_buff *skb, int offset,
2662 struct iov_iter *from, int len); 2666 struct iov_iter *from, int len);
2663int skb_copy_datagram_iter(const struct sk_buff *from, int offset,
2664 struct iov_iter *to, int size);
2665int zerocopy_sg_from_iter(struct sk_buff *skb, struct iov_iter *frm); 2667int zerocopy_sg_from_iter(struct sk_buff *skb, struct iov_iter *frm);
2666void skb_free_datagram(struct sock *sk, struct sk_buff *skb); 2668void skb_free_datagram(struct sock *sk, struct sk_buff *skb);
2667void skb_free_datagram_locked(struct sock *sk, struct sk_buff *skb); 2669void skb_free_datagram_locked(struct sock *sk, struct sk_buff *skb);
@@ -2689,12 +2691,14 @@ int skb_vlan_push(struct sk_buff *skb, __be16 vlan_proto, u16 vlan_tci);
2689 2691
2690static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len) 2692static inline int memcpy_from_msg(void *data, struct msghdr *msg, int len)
2691{ 2693{
2692 return memcpy_fromiovec(data, msg->msg_iov, len); 2694 /* XXX: stripping const */
2695 return memcpy_fromiovec(data, (struct iovec *)msg->msg_iter.iov, len);
2693} 2696}
2694 2697
2695static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len) 2698static inline int memcpy_to_msg(struct msghdr *msg, void *data, int len)
2696{ 2699{
2697 return memcpy_toiovec(msg->msg_iov, data, len); 2700 /* XXX: stripping const */
2701 return memcpy_toiovec((struct iovec *)msg->msg_iter.iov, data, len);
2698} 2702}
2699 2703
2700struct skb_checksum_ops { 2704struct skb_checksum_ops {
diff --git a/include/linux/socket.h b/include/linux/socket.h
index de5222832be4..048d6d6eed6d 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -47,8 +47,7 @@ struct linger {
47struct msghdr { 47struct msghdr {
48 void *msg_name; /* ptr to socket address structure */ 48 void *msg_name; /* ptr to socket address structure */
49 int msg_namelen; /* size of socket address structure */ 49 int msg_namelen; /* size of socket address structure */
50 struct iovec *msg_iov; /* scatter/gather array */ 50 struct iov_iter msg_iter; /* data */
51 __kernel_size_t msg_iovlen; /* # elements in msg_iov */
52 void *msg_control; /* ancillary data */ 51 void *msg_control; /* ancillary data */
53 __kernel_size_t msg_controllen; /* ancillary data buffer length */ 52 __kernel_size_t msg_controllen; /* ancillary data buffer length */
54 unsigned int msg_flags; /* flags on received message */ 53 unsigned int msg_flags; /* flags on received message */
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 4e23674d3649..bca6fc0a3196 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -911,7 +911,7 @@ static inline int l2cap_chan_no_memcpy_fromiovec(struct l2cap_chan *chan,
911 /* Following is safe since for compiler definitions of kvec and 911 /* Following is safe since for compiler definitions of kvec and
912 * iovec are identical, yielding the same in-core layout and alignment 912 * iovec are identical, yielding the same in-core layout and alignment
913 */ 913 */
914 struct kvec *vec = (struct kvec *)msg->msg_iov; 914 struct kvec *vec = (struct kvec *)msg->msg_iter.iov;
915 915
916 while (len > 0) { 916 while (len > 0) {
917 if (vec->iov_len) { 917 if (vec->iov_len) {
diff --git a/include/net/udplite.h b/include/net/udplite.h
index d5baaba65b46..ae7c8d1fbcad 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -20,7 +20,8 @@ static __inline__ int udplite_getfrag(void *from, char *to, int offset,
20 int len, int odd, struct sk_buff *skb) 20 int len, int odd, struct sk_buff *skb)
21{ 21{
22 struct msghdr *msg = from; 22 struct msghdr *msg = from;
23 return memcpy_fromiovecend(to, msg->msg_iov, offset, len); 23 /* XXX: stripping const */
24 return memcpy_fromiovecend(to, (struct iovec *)msg->msg_iter.iov, offset, len);
24} 25}
25 26
26/* Designate sk as UDP-Lite socket */ 27/* Designate sk as UDP-Lite socket */