drbd: Remove drbd_accept() and use kernel_accept() instead
authorPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 12 Jul 2012 08:25:35 +0000 (10:25 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 8 Nov 2012 15:58:30 +0000 (16:58 +0100)
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_receiver.c

index 8f25095..96ab2ff 100644 (file)
@@ -461,33 +461,6 @@ static void drbd_wait_ee_list_empty(struct drbd_conf *mdev,
        spin_unlock_irq(&mdev->tconn->req_lock);
 }
 
-/* see also kernel_accept; which is only present since 2.6.18.
- * also we want to log which part of it failed, exactly */
-static int drbd_accept(const char **what, struct socket *sock, struct socket **newsock)
-{
-       struct sock *sk = sock->sk;
-       int err = 0;
-
-       *what = "sock_create_lite";
-       err = sock_create_lite(sk->sk_family, sk->sk_type, sk->sk_protocol,
-                              newsock);
-       if (err < 0)
-               goto out;
-
-       *what = "accept";
-       err = sock->ops->accept(sock, *newsock, 0);
-       if (err < 0) {
-               sock_release(*newsock);
-               *newsock = NULL;
-               goto out;
-       }
-       (*newsock)->ops  = sock->ops;
-       __module_get((*newsock)->ops->owner);
-
-out:
-       return err;
-}
-
 static int drbd_recv_short(struct socket *sock, void *buf, size_t size, int flags)
 {
        mm_segment_t oldfs;
@@ -742,7 +715,8 @@ static struct socket *drbd_wait_for_connect(struct drbd_tconn *tconn)
        if (err < 0)
                goto out;
 
-       err = drbd_accept(&what, s_listen, &s_estab);
+       what = "accept";
+       err = kernel_accept(s_listen, &s_estab, 0);
 
 out:
        if (s_listen)