diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-24 16:44:09 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-09 16:28:23 -0500 |
commit | 56c39fb67cdb665ae67fba4975f5e20e6614cda6 (patch) | |
tree | d28b2a45a5892284bd8a11f97387f94002008599 | |
parent | f4362a2c9524678f0459cf410403f8595e5cfce5 (diff) |
switch l2cap ->memcpy_fromiovec() to msghdr
it'll die soon enough - now that kvec-backed iov_iter works regardless
of set_fs(), both instances will become copy_from_iter() as soon as
we introduce ->msg_iter...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | include/net/bluetooth/l2cap.h | 6 | ||||
-rw-r--r-- | net/bluetooth/l2cap_core.c | 4 | ||||
-rw-r--r-- | net/bluetooth/l2cap_sock.c | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 061e648052c8..4e23674d3649 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -608,7 +608,7 @@ struct l2cap_ops { | |||
608 | unsigned long len, int nb); | 608 | unsigned long len, int nb); |
609 | int (*memcpy_fromiovec) (struct l2cap_chan *chan, | 609 | int (*memcpy_fromiovec) (struct l2cap_chan *chan, |
610 | unsigned char *kdata, | 610 | unsigned char *kdata, |
611 | struct iovec *iov, | 611 | struct msghdr *msg, |
612 | int len); | 612 | int len); |
613 | }; | 613 | }; |
614 | 614 | ||
@@ -905,13 +905,13 @@ static inline long l2cap_chan_no_get_sndtimeo(struct l2cap_chan *chan) | |||
905 | 905 | ||
906 | static inline int l2cap_chan_no_memcpy_fromiovec(struct l2cap_chan *chan, | 906 | static inline int l2cap_chan_no_memcpy_fromiovec(struct l2cap_chan *chan, |
907 | unsigned char *kdata, | 907 | unsigned char *kdata, |
908 | struct iovec *iov, | 908 | struct msghdr *msg, |
909 | int len) | 909 | int len) |
910 | { | 910 | { |
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 *)iov; | 914 | struct kvec *vec = (struct kvec *)msg->msg_iov; |
915 | 915 | ||
916 | while (len > 0) { | 916 | while (len > 0) { |
917 | if (vec->iov_len) { | 917 | if (vec->iov_len) { |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 8e1273173020..5201d6167acb 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -2097,7 +2097,7 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan, | |||
2097 | int sent = 0; | 2097 | int sent = 0; |
2098 | 2098 | ||
2099 | if (chan->ops->memcpy_fromiovec(chan, skb_put(skb, count), | 2099 | if (chan->ops->memcpy_fromiovec(chan, skb_put(skb, count), |
2100 | msg->msg_iov, count)) | 2100 | msg, count)) |
2101 | return -EFAULT; | 2101 | return -EFAULT; |
2102 | 2102 | ||
2103 | sent += count; | 2103 | sent += count; |
@@ -2118,7 +2118,7 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan, | |||
2118 | *frag = tmp; | 2118 | *frag = tmp; |
2119 | 2119 | ||
2120 | if (chan->ops->memcpy_fromiovec(chan, skb_put(*frag, count), | 2120 | if (chan->ops->memcpy_fromiovec(chan, skb_put(*frag, count), |
2121 | msg->msg_iov, count)) | 2121 | msg, count)) |
2122 | return -EFAULT; | 2122 | return -EFAULT; |
2123 | 2123 | ||
2124 | sent += count; | 2124 | sent += count; |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index b0efb7202957..205b298d9efb 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -1338,9 +1338,9 @@ static struct sk_buff *l2cap_sock_alloc_skb_cb(struct l2cap_chan *chan, | |||
1338 | 1338 | ||
1339 | static int l2cap_sock_memcpy_fromiovec_cb(struct l2cap_chan *chan, | 1339 | static int l2cap_sock_memcpy_fromiovec_cb(struct l2cap_chan *chan, |
1340 | unsigned char *kdata, | 1340 | unsigned char *kdata, |
1341 | struct iovec *iov, int len) | 1341 | struct msghdr *msg, int len) |
1342 | { | 1342 | { |
1343 | return memcpy_fromiovec(kdata, iov, len); | 1343 | return memcpy_from_msg(kdata, msg, len); |
1344 | } | 1344 | } |
1345 | 1345 | ||
1346 | static void l2cap_sock_ready_cb(struct l2cap_chan *chan) | 1346 | static void l2cap_sock_ready_cb(struct l2cap_chan *chan) |