Skip to content

Commit

Permalink
switch l2cap ->memcpy_fromiovec() to msghdr
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Al Viro committed Dec 9, 2014
1 parent f4362a2 commit 56c39fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions include/net/bluetooth/l2cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ struct l2cap_ops {
unsigned long len, int nb);
int (*memcpy_fromiovec) (struct l2cap_chan *chan,
unsigned char *kdata,
struct iovec *iov,
struct msghdr *msg,
int len);
};

Expand Down Expand Up @@ -905,13 +905,13 @@ static inline long l2cap_chan_no_get_sndtimeo(struct l2cap_chan *chan)

static inline int l2cap_chan_no_memcpy_fromiovec(struct l2cap_chan *chan,
unsigned char *kdata,
struct iovec *iov,
struct msghdr *msg,
int len)
{
/* Following is safe since for compiler definitions of kvec and
* iovec are identical, yielding the same in-core layout and alignment
*/
struct kvec *vec = (struct kvec *)iov;
struct kvec *vec = (struct kvec *)msg->msg_iov;

while (len > 0) {
if (vec->iov_len) {
Expand Down
4 changes: 2 additions & 2 deletions net/bluetooth/l2cap_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2097,7 +2097,7 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan,
int sent = 0;

if (chan->ops->memcpy_fromiovec(chan, skb_put(skb, count),
msg->msg_iov, count))
msg, count))
return -EFAULT;

sent += count;
Expand All @@ -2118,7 +2118,7 @@ static inline int l2cap_skbuff_fromiovec(struct l2cap_chan *chan,
*frag = tmp;

if (chan->ops->memcpy_fromiovec(chan, skb_put(*frag, count),
msg->msg_iov, count))
msg, count))
return -EFAULT;

sent += count;
Expand Down
4 changes: 2 additions & 2 deletions net/bluetooth/l2cap_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1338,9 +1338,9 @@ static struct sk_buff *l2cap_sock_alloc_skb_cb(struct l2cap_chan *chan,

static int l2cap_sock_memcpy_fromiovec_cb(struct l2cap_chan *chan,
unsigned char *kdata,
struct iovec *iov, int len)
struct msghdr *msg, int len)
{
return memcpy_fromiovec(kdata, iov, len);
return memcpy_from_msg(kdata, msg, len);
}

static void l2cap_sock_ready_cb(struct l2cap_chan *chan)
Expand Down

0 comments on commit 56c39fb

Please sign in to comment.