Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / kernel / wait.c
index 5cdf169..59a82f6 100644 (file)
@@ -3,7 +3,6 @@
  *
  * (C) 2004 William Irwin, Oracle
  */
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/wait.h>
 #include <linux/hash.h>
 
+void init_waitqueue_head(wait_queue_head_t *q)
+{
+       spin_lock_init(&q->lock);
+       INIT_LIST_HEAD(&q->task_list);
+}
+
+EXPORT_SYMBOL(init_waitqueue_head);
+
 void fastcall add_wait_queue(wait_queue_head_t *q, wait_queue_t *wait)
 {
        unsigned long flags;
@@ -33,35 +40,13 @@ void fastcall add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t *wait)
 }
 EXPORT_SYMBOL(add_wait_queue_exclusive);
 
-int fastcall remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait)
+void fastcall remove_wait_queue(wait_queue_head_t *q, wait_queue_t *wait)
 {
        unsigned long flags;
-       struct list_head *list;
-       int seen, retval;
 
        spin_lock_irqsave(&q->lock, flags);
-       list = &q->task_list;
-       seen = 0;
-       retval = -1;
-
-       do {
-               struct list_head *next;
-               if (list == &wait->task_list)
-                       seen++;
-               next = list->next;
-               if (next->prev != list) {
-                       seen += 2;
-                       break;
-               }
-               list = next;
-       } while (list != &q->task_list);
-
-       if (seen == 1) {
-               __remove_wait_queue(q, wait);
-               retval = 0;
-       }
+       __remove_wait_queue(q, wait);
        spin_unlock_irqrestore(&q->lock, flags);
-       return retval;
 }
 EXPORT_SYMBOL(remove_wait_queue);