aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_receiver.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2012-09-03 08:04:23 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-09 08:11:38 -0500
commit1393b59f8c46001c8dbd47078881483cf97813c3 (patch)
tree0093ab8ecaab9d125e21c01acb58d7309b161270 /drivers/block/drbd/drbd_receiver.c
parent70f17b6bd18dfe33f40db7573baa663b866be6ba (diff)
drbd: Remove duplicate 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/drbd_receiver.c')
-rw-r--r--drivers/block/drbd/drbd_receiver.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index fed34a7bef4a..813759f1b6ad 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -490,22 +490,9 @@ static int drbd_recv_short(struct socket *sock, void *buf, size_t size, int flag
490 490
491static int drbd_recv(struct drbd_tconn *tconn, void *buf, size_t size) 491static int drbd_recv(struct drbd_tconn *tconn, void *buf, size_t size)
492{ 492{
493 mm_segment_t oldfs;
494 struct kvec iov = {
495 .iov_base = buf,
496 .iov_len = size,
497 };
498 struct msghdr msg = {
499 .msg_iovlen = 1,
500 .msg_iov = (struct iovec *)&iov,
501 .msg_flags = MSG_WAITALL | MSG_NOSIGNAL
502 };
503 int rv; 493 int rv;
504 494
505 oldfs = get_fs(); 495 rv = drbd_recv_short(tconn->data.socket, buf, size, 0);
506 set_fs(KERNEL_DS);
507 rv = sock_recvmsg(tconn->data.socket, &msg, size, msg.msg_flags);
508 set_fs(oldfs);
509 496
510 if (rv < 0) { 497 if (rv < 0) {
511 if (rv == -ECONNRESET) 498 if (rv == -ECONNRESET)