#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>
* 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
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;
}