From: Philipp Reisner Date: Fri, 17 Aug 2012 14:55:47 +0000 (+0200) Subject: drbd: Remove dead code X-Git-Tag: upstream/snapshot3+hdmi~6035^2~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dbd0820c6f7b7db9a97d63ea379fc174a63ddbca;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git drbd: Remove dead code Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe --- diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 64e6a61..264ea25 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -516,37 +516,15 @@ static int drbd_recv(struct drbd_conf *mdev, void *buf, size_t size) oldfs = get_fs(); set_fs(KERNEL_DS); - - for (;;) { - rv = sock_recvmsg(mdev->data.socket, &msg, size, msg.msg_flags); - if (rv == size) - break; - - /* Note: - * ECONNRESET other side closed the connection - * ERESTARTSYS (on sock) we got a signal - */ - - if (rv < 0) { - if (rv == -ECONNRESET) - dev_info(DEV, "sock was reset by peer\n"); - else if (rv != -ERESTARTSYS) - dev_err(DEV, "sock_recvmsg returned %d\n", rv); - break; - } else if (rv == 0) { - break; - } else { - /* signal came in, or peer/link went down, - * after we read a partial message - */ - /* D_ASSERT(signal_pending(current)); */ - break; - } - }; - + rv = sock_recvmsg(mdev->data.socket, &msg, size, msg.msg_flags); set_fs(oldfs); - if (rv == 0) { + if (rv < 0) { + if (rv == -ECONNRESET) + dev_info(DEV, "sock was reset by peer\n"); + else if (rv != -ERESTARTSYS) + dev_err(DEV, "sock_recvmsg returned %d\n", rv); + } else if (rv == 0) { if (test_bit(DISCONNECT_SENT, &mdev->flags)) { long t; /* time_left */ t = wait_event_timeout(mdev->state_wait, mdev->state.conn < C_CONNECTED,