#define wait_queue_entry_t wait_queue_t
#endif
+#ifndef HAVE_PREPARE_TO_WAIT_EVENT
+#define __add_wait_queue_entry_tail __add_wait_queue_tail
+#endif
+
#ifndef HAVE_WAIT_BIT_HEADER_H
struct wait_bit_queue_entry {
struct wait_bit_key key;
#ifndef HAVE_PREPARE_TO_WAIT_EVENT
-#define __add_wait_queue_entry_tail __add_wait_queue_tail
-
long prepare_to_wait_event(wait_queue_head_t *wq_head,
wait_queue_entry_t *wq_entry, int state)
{
wait.wqe.func = claim_mod_rpc_function;
spin_lock_irq(&cli->cl_mod_rpcs_waitq.lock);
- __add_wait_queue(&cli->cl_mod_rpcs_waitq, &wait.wqe);
+ __add_wait_queue_entry_tail(&cli->cl_mod_rpcs_waitq, &wait.wqe);
/* This wakeup will only succeed if the maximums haven't
- * been reached. If that happens, WQ_FLAG_WOKEN will be cleared
+ * been reached. If that happens, wait.woken will be set
* and there will be no need to wait.
* If a close_req was enqueue, ensure we search all the way to the
* end of the waitqueue for a close request.
__wake_up_locked_key(&cli->cl_mod_rpcs_waitq, TASK_NORMAL,
(void*)wait.close_req);
- /* XXX: handle spurious wakeups (from unknown yet source */
while (wait.woken == false) {
spin_unlock_irq(&cli->cl_mod_rpcs_waitq.lock);
wait_woken(&wait.wqe, TASK_UNINTERRUPTIBLE,