diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-24 10:42:55 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-09 16:29:03 -0500 |
commit | c0371da6047abd261bc483c744dbc7d81a116172 (patch) | |
tree | 73b4d685f311a83e04f3a684ce18225b409b3f5f /drivers/net/macvtap.c | |
parent | d838df2e5dcbb6ed4d82854869e9a30f9aeef6da (diff) |
put iov_iter into msghdr
Note that the code _using_ ->msg_iter at that point will be very
unhappy with anything other than unshifted iovec-backed iov_iter.
We still need to convert users to proper primitives.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/net/macvtap.c')
-rw-r--r-- | drivers/net/macvtap.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index ba1e5db2152e..2c157cced81f 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
@@ -1095,9 +1095,7 @@ static int macvtap_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1095 | struct msghdr *m, size_t total_len) | 1095 | struct msghdr *m, size_t total_len) |
1096 | { | 1096 | { |
1097 | struct macvtap_queue *q = container_of(sock, struct macvtap_queue, sock); | 1097 | struct macvtap_queue *q = container_of(sock, struct macvtap_queue, sock); |
1098 | struct iov_iter from; | 1098 | return macvtap_get_user(q, m, &m->msg_iter, m->msg_flags & MSG_DONTWAIT); |
1099 | iov_iter_init(&from, WRITE, m->msg_iov, m->msg_iovlen, total_len); | ||
1100 | return macvtap_get_user(q, m, &from, m->msg_flags & MSG_DONTWAIT); | ||
1101 | } | 1099 | } |
1102 | 1100 | ||
1103 | static int macvtap_recvmsg(struct kiocb *iocb, struct socket *sock, | 1101 | static int macvtap_recvmsg(struct kiocb *iocb, struct socket *sock, |
@@ -1105,12 +1103,10 @@ static int macvtap_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1105 | int flags) | 1103 | int flags) |
1106 | { | 1104 | { |
1107 | struct macvtap_queue *q = container_of(sock, struct macvtap_queue, sock); | 1105 | struct macvtap_queue *q = container_of(sock, struct macvtap_queue, sock); |
1108 | struct iov_iter to; | ||
1109 | int ret; | 1106 | int ret; |
1110 | if (flags & ~(MSG_DONTWAIT|MSG_TRUNC)) | 1107 | if (flags & ~(MSG_DONTWAIT|MSG_TRUNC)) |
1111 | return -EINVAL; | 1108 | return -EINVAL; |
1112 | iov_iter_init(&to, READ, m->msg_iov, m->msg_iovlen, total_len); | 1109 | ret = macvtap_do_read(q, &m->msg_iter, flags & MSG_DONTWAIT); |
1113 | ret = macvtap_do_read(q, &to, flags & MSG_DONTWAIT); | ||
1114 | if (ret > total_len) { | 1110 | if (ret > total_len) { |
1115 | m->msg_flags |= MSG_TRUNC; | 1111 | m->msg_flags |= MSG_TRUNC; |
1116 | ret = flags & MSG_TRUNC ? ret : total_len; | 1112 | ret = flags & MSG_TRUNC ? ret : total_len; |