Commit f7765c36 authored by Al Viro's avatar Al Viro

drbd: switch to sock_recvmsg()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 98583226
...@@ -1847,7 +1847,7 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock, ...@@ -1847,7 +1847,7 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock,
void *buf, size_t size, unsigned msg_flags) void *buf, size_t size, unsigned msg_flags)
{ {
struct kvec iov = {.iov_base = buf, .iov_len = size}; 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; int rv, sent = 0;
if (!sock) if (!sock)
...@@ -1855,12 +1855,6 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock, ...@@ -1855,12 +1855,6 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock,
/* THINK if (signal_pending) return ... ? */ /* 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); iov_iter_kvec(&msg.msg_iter, WRITE | ITER_KVEC, &iov, 1, size);
if (sock == connection->data.socket) { if (sock == connection->data.socket) {
......
...@@ -516,7 +516,8 @@ static int drbd_recv_short(struct socket *sock, void *buf, size_t size, int flag ...@@ -516,7 +516,8 @@ static int drbd_recv_short(struct socket *sock, void *buf, size_t size, int flag
struct msghdr msg = { struct msghdr msg = {
.msg_flags = (flags ? flags : MSG_WAITALL | MSG_NOSIGNAL) .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) static int drbd_recv(struct drbd_connection *connection, void *buf, size_t size)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment