Whamcloud - gitweb
LU-6261 gnilnd: Clean up cfs abstractions from gnilnd
[fs/lustre-release.git] / lnet / lnet / lib-socket.c
index 0b6fc00..5348ac0 100644 (file)
@@ -35,6 +35,9 @@
  */
 #define DEBUG_SUBSYSTEM S_LNET
 
+#ifdef HAVE_COMPAT_RDMA
+#include <linux/compat-2.6.h>
+#endif
 #include <linux/if.h>
 #include <linux/in.h>
 #include <linux/net.h>
@@ -89,8 +92,8 @@ lnet_sock_ioctl(int cmd, unsigned long arg)
        sock_filp = sock_alloc_file(sock, 0);
 # endif
 #endif
-       if (!sock_filp) {
-               rc = -ENOMEM;
+       if (IS_ERR(sock_filp)) {
+               rc = PTR_ERR(sock_filp);
                sock_release(sock);
                goto out;
        }
@@ -554,6 +557,13 @@ lnet_sock_listen(struct socket **sockp,
        return rc;
 }
 
+#ifndef HAVE_SK_SLEEP
+static inline wait_queue_head_t *sk_sleep(struct sock *sk)
+{
+       return sk->sk_sleep;
+}
+#endif
+
 int
 lnet_sock_accept(struct socket **newsockp, struct socket *sock)
 {