X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=libcfs%2Flibcfs%2Flinux%2Flinux-tcpip.c;h=5b314239a419130997ff2fd24e23bbf6c64fe9d0;hb=c8da7bfbe0505175869973b25281b152940774b0;hp=4f4d14ad736bfa6f1c6814079c2c841b9147c8fb;hpb=6e3ec5812ebd1b5ecf7cae584f429b013ffe7431;p=fs%2Flustre-release.git diff --git a/libcfs/libcfs/linux/linux-tcpip.c b/libcfs/libcfs/linux/linux-tcpip.c index 4f4d14a..5b31423 100644 --- a/libcfs/libcfs/linux/linux-tcpip.c +++ b/libcfs/libcfs/linux/linux-tcpip.c @@ -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. @@ -26,8 +24,10 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2012, Whamcloud, Inc. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -42,11 +42,7 @@ #include #include /* For sys_open & sys_close */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #include -#else -#include -#endif int libcfs_sock_ioctl(int cmd, unsigned long arg) @@ -84,14 +80,12 @@ libcfs_sock_ioctl(int cmd, unsigned long arg) #ifdef HAVE_UNLOCKED_IOCTL if (sock_filp->f_op->unlocked_ioctl) rc = sock_filp->f_op->unlocked_ioctl(sock_filp, cmd, arg); - else +#else + lock_kernel(); + rc = sock_filp->f_op->ioctl(sock_filp->f_dentry->d_inode, + sock_filp, cmd, arg); + unlock_kernel(); #endif - { - lock_kernel(); - rc =sock_filp->f_op->ioctl(sock_filp->f_dentry->d_inode, - sock_filp, cmd, arg); - unlock_kernel(); - } set_fs(oldmm); fput(sock_filp); @@ -621,7 +615,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) { @@ -630,7 +624,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) @@ -649,7 +643,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); @@ -683,7 +677,7 @@ libcfs_sock_connect (struct socket **sockp, int *fatal, * port... */ *fatal = !(rc == -EADDRNOTAVAIL); - CDEBUG(*fatal ? D_NETERROR : D_NET, + CDEBUG_LIMIT(*fatal ? D_NETERROR : D_NET, "Error %d connecting %u.%u.%u.%u/%d -> %u.%u.%u.%u/%d\n", rc, HIPQUAD(local_ip), local_port, HIPQUAD(peer_ip), peer_port);