vserver 1.9.5.x5
[linux-2.6.git] / mm / pdflush.c
index 1e682be..38ce279 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/gfp.h>
 #include <linux/init.h>
 #include <linux/module.h>
-#include <linux/suspend.h>
 #include <linux/fs.h>          // Needed by writeback.h
 #include <linux/writeback.h>   // Prototypes pdflush_operation()
 #include <linux/kthread.h>
@@ -45,7 +44,7 @@ static void start_one_pdflush_thread(void);
  * All the pdflush threads.  Protected by pdflush_lock
  */
 static LIST_HEAD(pdflush_list);
-static spinlock_t pdflush_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pdflush_lock);
 
 /*
  * The count of currently-running pdflush threads.  Protected
@@ -106,8 +105,7 @@ static int __pdflush(struct pdflush_work *my_work)
                spin_unlock_irq(&pdflush_lock);
 
                schedule();
-               if (current->flags & PF_FREEZE) {
-                       refrigerator(PF_FREEZE);
+               if (try_to_freeze(PF_FREEZE)) {
                        spin_lock_irq(&pdflush_lock);
                        continue;
                }