Skip to content

Commit

Permalink
drbd: Remove duplicate code
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
  • Loading branch information
Philipp Reisner committed Nov 9, 2012
1 parent 70f17b6 commit 1393b59
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
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;

oldfs = get_fs();
set_fs(KERNEL_DS);
rv = sock_recvmsg(tconn->data.socket, &msg, size, msg.msg_flags);
set_fs(oldfs);
rv = drbd_recv_short(tconn->data.socket, buf, size, 0);

if (rv < 0) {
if (rv == -ECONNRESET)
Expand Down

0 comments on commit 1393b59

Please sign in to comment.