diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2017-09-21 03:05:43 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-12-03 04:38:06 +0300 |
commit | f7765c364684085efeb81727757a52f2e1d20482 (patch) | |
tree | 136ff5e5bcd763b5658e81db6184e2ff618bf4fb /drivers/block | |
parent | 985832267da5698c2a3b90f6cc920ac49fe7cf1e (diff) | |
download | linux-f7765c364684085efeb81727757a52f2e1d20482.tar.xz |
drbd: switch to sock_recvmsg()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 8 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 3 |
2 files changed, 3 insertions, 8 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 4b4697a1f963..0a0394aa1b9c 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -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) { diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index cb2fa63f6bc0..c72dee0ef083 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -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) |