Whamcloud - gitweb
LU-2590 lod: magic changed after swab
[fs/lustre-release.git] / libcfs / libcfs / linux / linux-tcpip.c
index 9d673f0..cd07648 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,6 +26,8 @@
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -76,19 +76,10 @@ libcfs_sock_ioctl(int cmd, unsigned long arg)
                 goto out_fd;
         }
 
-        set_fs(KERNEL_DS);
-#ifdef HAVE_UNLOCKED_IOCTL
-        if (sock_filp->f_op->unlocked_ioctl)
-                rc = sock_filp->f_op->unlocked_ioctl(sock_filp, cmd, arg);
-        else
-#endif
-             {
-                lock_kernel();
-                rc =sock_filp->f_op->ioctl(sock_filp->f_dentry->d_inode,
-                                           sock_filp, cmd, arg);
-                unlock_kernel();
-             }
-        set_fs(oldmm);
+       set_fs(KERNEL_DS);
+       if (sock_filp->f_op->unlocked_ioctl)
+               rc = sock_filp->f_op->unlocked_ioctl(sock_filp, cmd, arg);
+       set_fs(oldmm);
 
         fput(sock_filp);
 
@@ -581,22 +572,6 @@ libcfs_sock_listen (struct socket **sockp,
 
 EXPORT_SYMBOL(libcfs_sock_listen);
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
-int sock_create_lite(int family, int type, int protocol, struct socket **res)
-{
-        struct socket *sock;
-
-        sock = sock_alloc();
-        if (sock == NULL)
-                return -ENOMEM;
-
-        sock->type = type;
-        *res = sock;
-
-        return 0;
-}
-#endif
-
 int
 libcfs_sock_accept (struct socket **newsockp, struct socket *sock)
 {
@@ -617,7 +592,7 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock)
         newsock->ops = sock->ops;
 
         set_current_state(TASK_INTERRUPTIBLE);
-        add_wait_queue(sock->sk->sk_sleep, &wait);
+        add_wait_queue(sk_sleep(sock->sk), &wait);
 
         rc = sock->ops->accept(sock, newsock, O_NONBLOCK);
         if (rc == -EAGAIN) {
@@ -626,7 +601,7 @@ libcfs_sock_accept (struct socket **newsockp, struct socket *sock)
                 rc = sock->ops->accept(sock, newsock, O_NONBLOCK);
         }
 
-        remove_wait_queue(sock->sk->sk_sleep, &wait);
+        remove_wait_queue(sk_sleep(sock->sk), &wait);
         set_current_state(TASK_RUNNING);
 
         if (rc != 0)
@@ -645,7 +620,7 @@ EXPORT_SYMBOL(libcfs_sock_accept);
 void
 libcfs_sock_abort_accept (struct socket *sock)
 {
-        wake_up_all(sock->sk->sk_sleep);
+        wake_up_all(sk_sleep(sock->sk));
 }
 
 EXPORT_SYMBOL(libcfs_sock_abort_accept);