diff options
| author | David S. Miller <davem@davemloft.net> | 2014-12-10 13:17:23 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-12-10 13:17:23 -0500 |
| commit | 6e5f59aacbf9527dfe425541c78cb8c56623e7eb (patch) | |
| tree | dc5614e1546dba2bd6896d4aa21410e1d3297a09 /include/net/bluetooth | |
| parent | 6c702fab626328c33b539b0c618a5511aed23bed (diff) | |
| parent | 218321e7a0838c2be974539f0a5341b398d4432b (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/bluetooth')
| -rw-r--r-- | include/net/bluetooth/l2cap.h | 29 |
1 files changed, 0 insertions, 29 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 | ||
| 617 | struct l2cap_conn { | 613 | struct 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 | ||
| 908 | static 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 | |||
| 933 | extern bool disable_ertm; | 904 | extern bool disable_ertm; |
| 934 | 905 | ||
| 935 | int l2cap_init_sockets(void); | 906 | int l2cap_init_sockets(void); |
