aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2012-07-12 04:25:35 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 10:58:30 -0500
commit7e0f096b8d3ffcf04955c239e80993ec451c9a1a (patch)
treedd80f52ca201f19d7f0a684a87e11d6cb2a48426 /drivers/block/drbd
parent2820fd396940756904bd7e4136115f493c63d369 (diff)
drbd: Remove drbd_accept() and use kernel_accept() instead
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.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 8f25095f390c..96ab2ffc2a41 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -461,33 +461,6 @@ static void drbd_wait_ee_list_empty(struct drbd_conf *mdev,
461 spin_unlock_irq(&mdev->tconn->req_lock); 461 spin_unlock_irq(&mdev->tconn->req_lock);
462} 462}
463 463
464/* see also kernel_accept; which is only present since 2.6.18.
465 * also we want to log which part of it failed, exactly */
466static int drbd_accept(const char **what, struct socket *sock, struct socket **newsock)
467{
468 struct sock *sk = sock->sk;
469 int err = 0;
470
471 *what = "sock_create_lite";
472 err = sock_create_lite(sk->sk_family, sk->sk_type, sk->sk_protocol,
473 newsock);
474 if (err < 0)
475 goto out;
476
477 *what = "accept";
478 err = sock->ops->accept(sock, *newsock, 0);
479 if (err < 0) {
480 sock_release(*newsock);
481 *newsock = NULL;
482 goto out;
483 }
484 (*newsock)->ops = sock->ops;
485 __module_get((*newsock)->ops->owner);
486
487out:
488 return err;
489}
490
491static int drbd_recv_short(struct socket *sock, void *buf, size_t size, int flags) 464static int drbd_recv_short(struct socket *sock, void *buf, size_t size, int flags)
492{ 465{
493 mm_segment_t oldfs; 466 mm_segment_t oldfs;
@@ -742,7 +715,8 @@ static struct socket *drbd_wait_for_connect(struct drbd_tconn *tconn)
742 if (err < 0) 715 if (err < 0)
743 goto out; 716 goto out;
744 717
745 err = drbd_accept(&what, s_listen, &s_estab); 718 what = "accept";
719 err = kernel_accept(s_listen, &s_estab, 0);
746 720
747out: 721out:
748 if (s_listen) 722 if (s_listen)