Another chunk of code thst is not needed on recent (2.6.9+) kernels.
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
+++ /dev/null
-/*********************************************************
- * 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__ */
#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
#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
# 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
#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"
/* 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"
#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>
#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"
struct sockaddr_vm *remoteAddr;
long timeout;
Bool oldPktProto = FALSE;
- COMPAT_DEFINE_WAIT(wait);
+ DEFINE_WAIT(wait);
err = 0;
sk = sock->sk;
* 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) {
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) {
}
outWait:
- compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING);
+ finish_wait(sk_sleep(sk), &wait);
out:
release_sock(sk);
return err;
struct sock *connected;
VSockVmciSock *vconnected;
long timeout;
- COMPAT_DEFINE_WAIT(wait);
+ DEFINE_WAIT(wait);
err = 0;
listener = sock->sk;
* 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) {
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) {
}
outWait:
- compat_finish_wait(sk_sleep(listener), &wait, TASK_RUNNING);
+ finish_wait(sk_sleep(listener), &wait);
out:
release_sock(listener);
return err;
int err;
VSockVmciSendNotifyData sendData;
- COMPAT_DEFINE_WAIT(wait);
+ DEFINE_WAIT(wait);
sk = sock->sk;
vsk = vsock_sk(sk);
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;
goto outWait;
}
- compat_cont_prepare_to_wait(sk_sleep(sk),
- &wait, TASK_INTERRUPTIBLE);
+ prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
}
/*
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;
VSockVmciRecvNotifyData recvData;
- COMPAT_DEFINE_WAIT(wait);
+ DEFINE_WAIT(wait);
sk = sock->sk;
vsk = vsock_sk(sk);
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 &&
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) {
err = copied;
outWait:
- compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING);
+ finish_wait(sk_sleep(sk), &wait);
out:
release_sock(sk);
return err;