]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Remove compat_wait.h
authorVMware, Inc <>
Mon, 26 Jul 2010 18:57:43 +0000 (11:57 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Mon, 26 Jul 2010 18:57:43 +0000 (11:57 -0700)
Another chunk of code thst is not needed on recent (2.6.9+) kernels.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/modules/linux/shared/compat_wait.h [deleted file]
open-vm-tools/modules/linux/shared/vmci_kernel_if.h
open-vm-tools/modules/linux/vmci/vmciKernelIf.c
open-vm-tools/modules/linux/vmci/vmciUtil.c
open-vm-tools/modules/linux/vmci/vmci_drv.c
open-vm-tools/modules/linux/vmhgfs/request.h
open-vm-tools/modules/linux/vsock/linux/af_vsock.c

diff --git a/open-vm-tools/modules/linux/shared/compat_wait.h b/open-vm-tools/modules/linux/shared/compat_wait.h
deleted file mode 100644 (file)
index 08ae86c..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*********************************************************
- * Copyright (C) 2002 VMware, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 and no later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- *
- *********************************************************/
-
-#ifndef __COMPAT_WAIT_H__
-#   define __COMPAT_WAIT_H__
-
-
-#include <linux/wait.h>
-#include <linux/poll.h>
-#include <linux/file.h>
-
-
-/*
- * The DECLARE_WAITQUEUE() API appeared in 2.3.1
- * It was back ported in 2.2.18
- *
- *  --hpreg
- */
-
-#ifndef DECLARE_WAITQUEUE
-
-typedef struct wait_queue *wait_queue_head_t;
-#   define init_waitqueue_head(_headPtr) *(_headPtr) = NULL
-#   define DECLARE_WAITQUEUE(_var, _task) \
-   struct wait_queue _var = {_task, NULL, }
-
-typedef struct wait_queue wait_queue_t;
-#   define init_waitqueue_entry(_wait, _task) ((_wait)->task = (_task))
-
-#endif
-
-
-/*
- * The wait_event_interruptible_timeout() interface is not
- * defined in pre-2.6 kernels.
- */
-#ifndef wait_event_interruptible_timeout
-#define __wait_event_interruptible_timeout(wq, condition, ret)         \
-do {                                                                   \
-   wait_queue_t __wait;                                                        \
-   init_waitqueue_entry(&__wait, current);                             \
-                                                                       \
-   add_wait_queue(&wq, &__wait);                                       \
-   for (;;) {                                                          \
-      set_current_state(TASK_INTERRUPTIBLE);                           \
-      if (condition)                                                   \
-        break;                                                         \
-      if (!signal_pending(current)) {                                  \
-        ret = schedule_timeout(ret);                                   \
-        if (!ret)                                                      \
-           break;                                                      \
-        continue;                                                      \
-      }                                                                        \
-      ret = -ERESTARTSYS;                                              \
-      break;                                                           \
-   }                                                                   \
-   set_current_state(TASK_RUNNING);                                    \
-   remove_wait_queue(&wq, &__wait);                                    \
-} while (0)
-
-#define wait_event_interruptible_timeout(wq, condition, timeout)       \
-({                                                                     \
-   long __ret = timeout;                                               \
-   if (!(condition))                                                   \
-      __wait_event_interruptible_timeout(wq, condition, __ret);         \
-   __ret;                                                              \
-})
-#endif
-
-/*
- * The wait_event_timeout() interface is not
- * defined in pre-2.6 kernels.
- */
-#ifndef wait_event_timeout
-#define __wait_event_timeout(wq, condition, ret)                       \
-do {                                                                   \
-   wait_queue_t __wait;                                                        \
-   init_waitqueue_entry(&__wait, current);                             \
-                                                                       \
-   add_wait_queue(&wq, &__wait);                                       \
-   for (;;) {                                                          \
-      set_current_state(TASK_UNINTERRUPTIBLE);                         \
-      if (condition)                                                   \
-         break;                                                                \
-      ret = schedule_timeout(ret);                                     \
-      if (!ret)                                                                \
-         break;                                                                \
-   }                                                                   \
-   set_current_state(TASK_RUNNING);                                    \
-   remove_wait_queue(&wq, &__wait);                                    \
-} while (0)
-
-#define wait_event_timeout(wq, condition, timeout)                     \
-({                                                                     \
-   long __ret = timeout;                                               \
-   if (!(condition))                                                   \
-      __wait_event_timeout(wq, condition, __ret);                       \
-   __ret;                                                              \
-})
-#endif
-
-/*
- * DEFINE_WAIT() and friends were added in 2.5.39 and backported to 2.4.28.
- *
- * Unfortunately it is not true. While some distros may have done it the
- * change has never made it into vanilla 2.4 kernel. Instead of testing
- * particular kernel versions let's just test for presence of DEFINE_WAIT
- * when figuring out whether we need to provide replacement implementation
- * or simply alias existing one.
- */
-
-#ifndef DEFINE_WAIT
-
-# define COMPAT_DEFINE_WAIT(_wait)                              \
-   DECLARE_WAITQUEUE(_wait, current)
-# define compat_init_prepare_to_wait(_sleep, _wait, _state)     \
-   do {                                                         \
-      __set_current_state(_state);                              \
-      add_wait_queue(_sleep, _wait);                            \
-   } while (0)
-# define compat_cont_prepare_to_wait(_sleep, _wait, _state)     \
-   set_current_state(_state)
-# define compat_finish_wait(_sleep, _wait, _state)              \
-   do {                                                         \
-      __set_current_state(_state);                              \
-      remove_wait_queue(_sleep, _wait);                         \
-   } while (0)
-
-#else
-
-# define COMPAT_DEFINE_WAIT(_wait)                              \
-   DEFINE_WAIT(_wait)
-# define compat_init_prepare_to_wait(_sleep, _wait, _state)     \
-   prepare_to_wait(_sleep, _wait, _state)
-# define compat_cont_prepare_to_wait(_sleep, _wait, _state)     \
-   prepare_to_wait(_sleep, _wait, _state)
-# define compat_finish_wait(_sleep, _wait, _state)              \
-   finish_wait(_sleep, _wait)
-
-#endif /* #ifndef DEFINE_WAIT */
-
-#endif /* __COMPAT_WAIT_H__ */
index ae0fe0f17a339409a2b6c1884cb6592ec3b25173..74e44336802ad1cab56890b09d0027f5a130da8d 100644 (file)
@@ -37,8 +37,8 @@
 #endif 
 
 #if defined(linux) && !defined(VMKERNEL)
+#  include <linux/wait.h>
 #  include "compat_version.h"
-#  include "compat_wait.h"
 #  include "compat_spinlock.h"
 #  include "compat_semaphore.h"
 #endif // linux
index 0589b795dfca6bcc44b6383720a6ec95f2acb874..1fdcced63b424983f9f22050039ae3902bff392c 100644 (file)
 
 #define EXPORT_SYMTAB
 #define __NO_VERSION__
-#include "compat_module.h"
 
+#include <linux/mm.h>           /* For vmalloc_to_page() and get_user_pages()*/
+#include <linux/pagemap.h>      /* For page_cache_release() */
+#include <linux/socket.h>       /* For memcpy_{to,from}iovec(). */
+#include <linux/wait.h>
+#include <linux/vmalloc.h>
+
+#include "compat_module.h"
 #include "compat_version.h"
 #include "compat_sched.h"
-#include "compat_wait.h"
 #include "compat_workqueue.h"
 #include "compat_interrupt.h"
 #include "compat_spinlock.h"
 #include "compat_mm.h"
 #include "compat_highmem.h"
 #include "vm_basic_types.h"
-#include <linux/vmalloc.h>
-#include <linux/mm.h>           /* For vmalloc_to_page() and get_user_pages()*/
-#include <linux/socket.h>       /* For memcpy_{to,from}iovec(). */
-#include <linux/pagemap.h>      /* For page_cache_release() */
 #include "vm_assert.h"
 #include "vmci_kernel_if.h"
 #ifndef VMX86_TOOLS
index f6620abd8391c7d11e9fa94755e3acee1c271643..7fb8d7c6db00635b4cb00dddee017fad744b27e5 100644 (file)
 
 #  define EXPORT_SYMTAB
 
-#  include <linux/module.h>
 #  include <linux/module.h>
 #  include "compat_kernel.h"
 #  include "compat_slab.h"
-#  include "compat_wait.h"
 #  include "compat_interrupt.h"
 #elif defined(_WIN32)
 #  ifndef WINNT_DDK
index a3d4b5c511a5e9863a5da421e38c611bd225605a..cd85a16ea698ee8502862499d2e8a3c173e8b3d2 100644 (file)
 #include "driver-config.h"
 
 #include <linux/moduleparam.h>
+#include <linux/poll.h>
 
 #include "compat_kernel.h"
 #include "compat_module.h"
 #include "compat_pci.h"
-#include "compat_wait.h"
 #include "compat_init.h"
 #include "compat_ioport.h"
 #include "compat_interrupt.h"
index 3eae8389ee260f98d844c755cf35aa66aa9fc390..055f857d97cdee6d4cae5b0fe4babdc00e281aad 100644 (file)
 /* Must come before any kernel header file. */
 #include "driver-config.h"
 
+#include <linux/kref.h>
 #include <linux/list.h>
+#include <linux/wait.h>
 #include "compat_sched.h"
 #include "compat_spinlock.h"
-#include "compat_wait.h"
 
 #include "hgfs.h" /* For common HGFS definitions. */
 #include "hgfsTransport.h"
index 7968931fe6bebbd0e4b108891445ebe03131f76e..9ef5d2f86658c61b7e19a684290f08ba859421d6 100644 (file)
 #include <linux/smp_lock.h>
 #include <linux/bitops.h>
 #include <linux/list.h>
+#include <linux/wait.h>
 #include <asm/io.h>
 #if defined(__x86_64__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12)
 #   include <linux/ioctl32.h>
@@ -117,7 +118,6 @@ sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
 #include "compat_kernel.h"
 #include "compat_init.h"
 #include "compat_sock.h"
-#include "compat_wait.h"
 #include "compat_version.h"
 #include "compat_workqueue.h"
 #include "compat_mutex.h"
@@ -3385,7 +3385,7 @@ VSockVmciStreamConnect(struct socket *sock,   // IN
    struct sockaddr_vm *remoteAddr;
    long timeout;
    Bool oldPktProto = FALSE;
-   COMPAT_DEFINE_WAIT(wait);
+   DEFINE_WAIT(wait);
 
    err = 0;
    sk = sock->sk;
@@ -3480,7 +3480,7 @@ VSockVmciStreamConnect(struct socket *sock,   // IN
     * a notification of an error.
     */
    timeout = sock_sndtimeo(sk, flags & O_NONBLOCK);
-   compat_init_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+   prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
 
    while (sk->sk_state != SS_CONNECTED && sk->sk_err == 0) {
       if (timeout == 0) {
@@ -3503,7 +3503,7 @@ VSockVmciStreamConnect(struct socket *sock,   // IN
          goto outWaitError;
       }
 
-      compat_cont_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+      prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
    }
 
    if (sk->sk_err) {
@@ -3515,7 +3515,7 @@ VSockVmciStreamConnect(struct socket *sock,   // IN
    }
 
 outWait:
-   compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING);
+   finish_wait(sk_sleep(sk), &wait);
 out:
    release_sock(sk);
    return err;
@@ -3553,7 +3553,7 @@ VSockVmciAccept(struct socket *sock,     // IN
    struct sock *connected;
    VSockVmciSock *vconnected;
    long timeout;
-   COMPAT_DEFINE_WAIT(wait);
+   DEFINE_WAIT(wait);
 
    err = 0;
    listener = sock->sk;
@@ -3575,7 +3575,7 @@ VSockVmciAccept(struct socket *sock,     // IN
     * upon connection establishment.
     */
    timeout = sock_sndtimeo(listener, flags & O_NONBLOCK);
-   compat_init_prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE);
+   prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE);
 
    while ((connected = VSockVmciDequeueAccept(listener)) == NULL &&
           listener->sk_err == 0) {
@@ -3591,7 +3591,7 @@ VSockVmciAccept(struct socket *sock,     // IN
          goto outWait;
       }
 
-      compat_cont_prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE);
+      prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE);
    }
 
    if (listener->sk_err) {
@@ -3625,7 +3625,7 @@ VSockVmciAccept(struct socket *sock,     // IN
    }
 
 outWait:
-   compat_finish_wait(sk_sleep(listener), &wait, TASK_RUNNING);
+   finish_wait(sk_sleep(listener), &wait);
 out:
    release_sock(listener);
    return err;
@@ -4275,7 +4275,7 @@ VSockVmciStreamSendmsg(struct kiocb *kiocb,          // UNUSED
    int err;
    VSockVmciSendNotifyData sendData;
 
-   COMPAT_DEFINE_WAIT(wait);
+   DEFINE_WAIT(wait);
 
    sk = sock->sk;
    vsk = vsock_sk(sk);
@@ -4322,7 +4322,7 @@ VSockVmciStreamSendmsg(struct kiocb *kiocb,          // UNUSED
       goto out;
    }
 
-   compat_init_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+   prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
 
    while (totalWritten < len) {
       Bool sentWrote;
@@ -4360,8 +4360,7 @@ VSockVmciStreamSendmsg(struct kiocb *kiocb,          // UNUSED
             goto outWait;
          }
 
-         compat_cont_prepare_to_wait(sk_sleep(sk),
-                                     &wait, TASK_INTERRUPTIBLE);
+         prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
       }
 
       /*
@@ -4412,7 +4411,7 @@ outWait:
    if (totalWritten > 0) {
       err = totalWritten;
    }
-   compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING);
+   finish_wait(sk_sleep(sk), &wait);
 out:
    release_sock(sk);
    return err;
@@ -4543,7 +4542,7 @@ VSockVmciStreamRecvmsg(struct kiocb *kiocb,          // UNUSED
 
    VSockVmciRecvNotifyData recvData;
 
-   COMPAT_DEFINE_WAIT(wait);
+   DEFINE_WAIT(wait);
 
    sk = sock->sk;
    vsk = vsock_sk(sk);
@@ -4598,7 +4597,7 @@ VSockVmciStreamRecvmsg(struct kiocb *kiocb,          // UNUSED
       goto out;
    }
 
-   compat_init_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+   prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
 
    while ((ready = VSockVmciStreamHasData(vsk)) < target &&
           sk->sk_err == 0 &&
@@ -4638,7 +4637,7 @@ VSockVmciStreamRecvmsg(struct kiocb *kiocb,          // UNUSED
          goto outWait;
       }
 
-      compat_cont_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+      prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
    }
 
    if (sk->sk_err) {
@@ -4702,7 +4701,7 @@ VSockVmciStreamRecvmsg(struct kiocb *kiocb,          // UNUSED
    err = copied;
 
 outWait:
-   compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING);
+   finish_wait(sk_sleep(sk), &wait);
 out:
    release_sock(sk);
    return err;