summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-02-08 21:07:38 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2014-04-01 23:19:32 -0400
commitf730c848affc05fb7262574b06e0cd7e1fa96096 (patch)
treed92fa6f21ee3b316e85ca8e86d97819c92951def /drivers/block
parent86d564c84c38b1ec06d9f2120d6a7373dcaeff0c (diff)
drbd: don't open-code kernel_recvmsg()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/drbd/drbd_receiver.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index d073305ffd5e..1385714eccb7 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -468,24 +468,14 @@ static void drbd_wait_ee_list_empty(struct drbd_conf *mdev,
static int drbd_recv_short(struct socket *sock, void *buf, size_t size, int flags)
{
- mm_segment_t oldfs;
struct kvec iov = {
.iov_base = buf,
.iov_len = size,
};
struct msghdr msg = {
- .msg_iovlen = 1,
- .msg_iov = (struct iovec *)&iov,
.msg_flags = (flags ? flags : MSG_WAITALL | MSG_NOSIGNAL)
};
- int rv;
-
- oldfs = get_fs();
- set_fs(KERNEL_DS);
- rv = sock_recvmsg(sock, &msg, size, msg.msg_flags);
- set_fs(oldfs);
-
- return rv;
+ return kernel_recvmsg(sock, &msg, &iov, 1, size, msg.msg_flags);
}
static int drbd_recv(struct drbd_tconn *tconn, void *buf, size_t size)