Commit 1393b59f authored by Philipp Reisner's avatar Philipp Reisner

drbd: Remove duplicate code

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 70f17b6b
...@@ -490,22 +490,9 @@ static int drbd_recv_short(struct socket *sock, void *buf, size_t size, int flag ...@@ -490,22 +490,9 @@ static int drbd_recv_short(struct socket *sock, void *buf, size_t size, int flag
static int drbd_recv(struct drbd_tconn *tconn, void *buf, size_t size) static int drbd_recv(struct drbd_tconn *tconn, void *buf, size_t size)
{ {
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 = MSG_WAITALL | MSG_NOSIGNAL
};
int rv; int rv;
oldfs = get_fs(); rv = drbd_recv_short(tconn->data.socket, buf, size, 0);
set_fs(KERNEL_DS);
rv = sock_recvmsg(tconn->data.socket, &msg, size, msg.msg_flags);
set_fs(oldfs);
if (rv < 0) { if (rv < 0) {
if (rv == -ECONNRESET) if (rv == -ECONNRESET)
......
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