aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-12-10 13:17:23 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-10 13:17:23 -0500
commit6e5f59aacbf9527dfe425541c78cb8c56623e7eb (patch)
treedc5614e1546dba2bd6896d4aa21410e1d3297a09 /include/net
parent6c702fab626328c33b539b0c618a5511aed23bed (diff)
parent218321e7a0838c2be974539f0a5341b398d4432b (diff)
Merge branch 'for-davem-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
More iov_iter work for the networking from Al Viro. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/l2cap.h29
-rw-r--r--include/net/udplite.h4
2 files changed, 3 insertions, 30 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index eee3ef530e79..d1bb342d083f 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -608,10 +608,6 @@ struct l2cap_ops {
608 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, 608 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
609 unsigned long hdr_len, 609 unsigned long hdr_len,
610 unsigned long len, int nb); 610 unsigned long len, int nb);
611 int (*memcpy_fromiovec) (struct l2cap_chan *chan,
612 unsigned char *kdata,
613 struct iovec *iov,
614 int len);
615}; 611};
616 612
617struct l2cap_conn { 613struct l2cap_conn {
@@ -905,31 +901,6 @@ static inline long l2cap_chan_no_get_sndtimeo(struct l2cap_chan *chan)
905 return 0; 901 return 0;
906} 902}
907 903
908static inline int l2cap_chan_no_memcpy_fromiovec(struct l2cap_chan *chan,
909 unsigned char *kdata,
910 struct iovec *iov,
911 int len)
912{
913 /* Following is safe since for compiler definitions of kvec and
914 * iovec are identical, yielding the same in-core layout and alignment
915 */
916 struct kvec *vec = (struct kvec *)iov;
917
918 while (len > 0) {
919 if (vec->iov_len) {
920 int copy = min_t(unsigned int, len, vec->iov_len);
921 memcpy(kdata, vec->iov_base, copy);
922 len -= copy;
923 kdata += copy;
924 vec->iov_base += copy;
925 vec->iov_len -= copy;
926 }
927 vec++;
928 }
929
930 return 0;
931}
932
933extern bool disable_ertm; 904extern bool disable_ertm;
934 905
935int l2cap_init_sockets(void); 906int l2cap_init_sockets(void);
diff --git a/include/net/udplite.h b/include/net/udplite.h
index 9a28a5179400..ae7c8d1fbcad 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -19,7 +19,9 @@ extern struct udp_table udplite_table;
19static __inline__ int udplite_getfrag(void *from, char *to, int offset, 19static __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 return memcpy_fromiovecend(to, (struct iovec *) from, offset, len); 22 struct msghdr *msg = from;
23 /* XXX: stripping const */
24 return memcpy_fromiovecend(to, (struct iovec *)msg->msg_iter.iov, offset, len);
23} 25}
24 26
25/* Designate sk as UDP-Lite socket */ 27/* Designate sk as UDP-Lite socket */