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>
This commit is contained in:
@@ -404,7 +404,6 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
|
||||
int ret = 0, nonblock = msg_flags & MSG_DONTWAIT;
|
||||
DECLARE_SOCKADDR(struct sockaddr_in *, sin, msg->msg_name);
|
||||
struct rds_incoming *inc = NULL;
|
||||
struct iov_iter to;
|
||||
|
||||
/* udp_recvmsg()->sock_recvtimeo() gets away without locking too.. */
|
||||
timeo = sock_rcvtimeo(sk, nonblock);
|
||||
@@ -415,6 +414,7 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
|
||||
goto out;
|
||||
|
||||
while (1) {
|
||||
struct iov_iter save;
|
||||
/* If there are pending notifications, do those - and nothing else */
|
||||
if (!list_empty(&rs->rs_notify_queue)) {
|
||||
ret = rds_notify_queue_get(rs, msg);
|
||||
@@ -450,8 +450,8 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
|
||||
rdsdebug("copying inc %p from %pI4:%u to user\n", inc,
|
||||
&inc->i_conn->c_faddr,
|
||||
ntohs(inc->i_hdr.h_sport));
|
||||
iov_iter_init(&to, READ, msg->msg_iov, msg->msg_iovlen, size);
|
||||
ret = inc->i_conn->c_trans->inc_copy_to_user(inc, &to);
|
||||
save = msg->msg_iter;
|
||||
ret = inc->i_conn->c_trans->inc_copy_to_user(inc, &msg->msg_iter);
|
||||
if (ret < 0)
|
||||
break;
|
||||
|
||||
@@ -464,6 +464,7 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
|
||||
rds_inc_put(inc);
|
||||
inc = NULL;
|
||||
rds_stats_inc(s_recv_deliver_raced);
|
||||
msg->msg_iter = save;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -934,9 +934,7 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
|
||||
int queued = 0, allocated_mr = 0;
|
||||
int nonblock = msg->msg_flags & MSG_DONTWAIT;
|
||||
long timeo = sock_sndtimeo(sk, nonblock);
|
||||
struct iov_iter from;
|
||||
|
||||
iov_iter_init(&from, WRITE, msg->msg_iov, msg->msg_iovlen, payload_len);
|
||||
/* Mirror Linux UDP mirror of BSD error message compatibility */
|
||||
/* XXX: Perhaps MSG_MORE someday */
|
||||
if (msg->msg_flags & ~(MSG_DONTWAIT | MSG_CMSG_COMPAT)) {
|
||||
@@ -984,7 +982,7 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
ret = rds_message_copy_from_user(rm, &from);
|
||||
ret = rds_message_copy_from_user(rm, &msg->msg_iter);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
|
Reference in New Issue
Block a user