drbd: switch to sock_recvmsg()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
985832267d
commit
f7765c3646
@ -1847,7 +1847,7 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock,
|
||||
void *buf, size_t size, unsigned msg_flags)
|
||||
{
|
||||
struct kvec iov = {.iov_base = buf, .iov_len = size};
|
||||
struct msghdr msg;
|
||||
struct msghdr msg = {.msg_flags = msg_flags | MSG_NOSIGNAL};
|
||||
int rv, sent = 0;
|
||||
|
||||
if (!sock)
|
||||
@ -1855,12 +1855,6 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock,
|
||||
|
||||
/* THINK if (signal_pending) return ... ? */
|
||||
|
||||
msg.msg_name = NULL;
|
||||
msg.msg_namelen = 0;
|
||||
msg.msg_control = NULL;
|
||||
msg.msg_controllen = 0;
|
||||
msg.msg_flags = msg_flags | MSG_NOSIGNAL;
|
||||
|
||||
iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, &iov, 1, size);
|
||||
|
||||
if (sock == connection->data.socket) {
|
||||
|
@ -516,7 +516,8 @@ static int drbd_recv_short(struct socket *sock, void *buf, size_t size, int flag
|
||||
struct msghdr msg = {
|
||||
.msg_flags = (flags ? flags : MSG_WAITALL | MSG_NOSIGNAL)
|
||||
};
|
||||
return kernel_recvmsg(sock, &msg, &iov, 1, size, msg.msg_flags);
|
||||
iov_iter_kvec(&msg.msg_iter, READ | ITER_KVEC, &iov, 1, size);
|
||||
return sock_recvmsg(sock, &msg, msg.msg_flags);
|
||||
}
|
||||
|
||||
static int drbd_recv(struct drbd_connection *connection, void *buf, size_t size)
|
||||
|
Loading…
Reference in New Issue
Block a user