diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2012-08-08 21:19:09 +0200 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-09 14:08:19 +0100 |
commit | 155522df5b8ac24ee66a903e51d5b3023b2a76f9 (patch) | |
tree | 65df69345129f3ce142507f7bfa7667ea4bbb2c0 /drivers/block/drbd | |
parent | b66623e33efbbf55717df7bfc49882371118b866 (diff) |
drbd: Remove dead code
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 1a8f698021a2..4ba530cf810f 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -504,37 +504,15 @@ static int drbd_recv(struct drbd_tconn *tconn, void *buf, size_t size) oldfs = get_fs(); set_fs(KERNEL_DS); - - for (;;) { - rv = sock_recvmsg(tconn->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) - conn_info(tconn, "sock was reset by peer\n"); - else if (rv != -ERESTARTSYS) - conn_err(tconn, "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(tconn->data.socket, &msg, size, msg.msg_flags); set_fs(oldfs); - if (rv == 0) { + if (rv < 0) { + if (rv == -ECONNRESET) + conn_info(tconn, "sock was reset by peer\n"); + else if (rv != -ERESTARTSYS) + conn_err(tconn, "sock_recvmsg returned %d\n", rv); + } else if (rv == 0) { if (test_bit(DISCONNECT_SENT, &tconn->flags)) { long t; rcu_read_lock(); |