diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2009-04-19 21:25:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-21 08:42:44 -0400 |
commit | 0a1ec07a67bd8b0033dace237249654d015efa21 (patch) | |
tree | 1963b9ba273f0786c8a972c27b5599dfb4a19f06 /include | |
parent | 0cededf3ffbb775c3716aa1d246338fdc24b1259 (diff) |
net: skb_copy_datagram_const_iovec()
There's an skb_copy_datagram_iovec() to copy out of a paged skb,
but it modifies the iovec, and does not support starting
at an offset in the destination. We want both in tun.c, so let's
add the function.
It's a carbon copy of skb_copy_datagram_iovec() with enough changes to
be annoying.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/skbuff.h | 5 | ||||
-rw-r--r-- | include/linux/socket.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 5fd389162f01..af2b21bdda83 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1717,6 +1717,11 @@ extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, | |||
1717 | int offset, | 1717 | int offset, |
1718 | struct iovec *from, | 1718 | struct iovec *from, |
1719 | int len); | 1719 | int len); |
1720 | extern int skb_copy_datagram_const_iovec(const struct sk_buff *from, | ||
1721 | int offset, | ||
1722 | const struct iovec *to, | ||
1723 | int to_offset, | ||
1724 | int size); | ||
1720 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); | 1725 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); |
1721 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, | 1726 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, |
1722 | unsigned int flags); | 1727 | unsigned int flags); |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 421afb4d29b0..171b08db9c4f 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -318,6 +318,8 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | |||
318 | 318 | ||
319 | extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); | 319 | extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); |
320 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); | 320 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); |
321 | extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, | ||
322 | int offset, int len); | ||
321 | extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uaddr, int __user *ulen); | 323 | extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uaddr, int __user *ulen); |
322 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); | 324 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); |
323 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); | 325 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); |