Commit 8cf4ec99 authored by Dave Kleikamp's avatar Dave Kleikamp

JFS: swsusp support

parent 9bda462a
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/buffer_head.h> /* for sync_blockdev() */ #include <linux/buffer_head.h> /* for sync_blockdev() */
#include <linux/bio.h> #include <linux/bio.h>
#include <linux/suspend.h>
#include "jfs_incore.h" #include "jfs_incore.h"
#include "jfs_filsys.h" #include "jfs_filsys.h"
#include "jfs_metapage.h" #include "jfs_metapage.h"
...@@ -2141,12 +2142,17 @@ int jfsIOWait(void *arg) ...@@ -2141,12 +2142,17 @@ int jfsIOWait(void *arg)
lbmStartIO(bp); lbmStartIO(bp);
spin_lock_irq(&log_redrive_lock); spin_lock_irq(&log_redrive_lock);
} }
if (current->flags & PF_FREEZE) {
spin_unlock_irq(&log_redrive_lock);
refrigerator(PF_IOTHREAD);
} else {
add_wait_queue(&jfs_IO_thread_wait, &wq); add_wait_queue(&jfs_IO_thread_wait, &wq);
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
spin_unlock_irq(&log_redrive_lock); spin_unlock_irq(&log_redrive_lock);
schedule(); schedule();
current->state = TASK_RUNNING; current->state = TASK_RUNNING;
remove_wait_queue(&jfs_IO_thread_wait, &wq); remove_wait_queue(&jfs_IO_thread_wait, &wq);
}
} while (!jfs_stop_threads); } while (!jfs_stop_threads);
jFYI(1,("jfsIOWait being killed!\n")); jFYI(1,("jfsIOWait being killed!\n"));
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/suspend.h>
#include "jfs_incore.h" #include "jfs_incore.h"
#include "jfs_filsys.h" #include "jfs_filsys.h"
#include "jfs_metapage.h" #include "jfs_metapage.h"
...@@ -2789,8 +2790,6 @@ int jfs_lazycommit(void *arg) ...@@ -2789,8 +2790,6 @@ int jfs_lazycommit(void *arg)
complete(&jfsIOwait); complete(&jfsIOwait);
do { do {
DECLARE_WAITQUEUE(wq, current);
LAZY_LOCK(flags); LAZY_LOCK(flags);
restart: restart:
WorkDone = 0; WorkDone = 0;
...@@ -2825,12 +2824,19 @@ int jfs_lazycommit(void *arg) ...@@ -2825,12 +2824,19 @@ int jfs_lazycommit(void *arg)
if (WorkDone) if (WorkDone)
goto restart; goto restart;
if (current->flags & PF_FREEZE) {
LAZY_UNLOCK(flags);
refrigerator(PF_IOTHREAD);
} else {
DECLARE_WAITQUEUE(wq, current);
add_wait_queue(&jfs_commit_thread_wait, &wq); add_wait_queue(&jfs_commit_thread_wait, &wq);
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
LAZY_UNLOCK(flags); LAZY_UNLOCK(flags);
schedule(); schedule();
current->state = TASK_RUNNING; current->state = TASK_RUNNING;
remove_wait_queue(&jfs_commit_thread_wait, &wq); remove_wait_queue(&jfs_commit_thread_wait, &wq);
}
} while (!jfs_stop_threads); } while (!jfs_stop_threads);
if (TxAnchor.unlock_queue) if (TxAnchor.unlock_queue)
...@@ -2981,7 +2987,6 @@ int jfs_sync(void *arg) ...@@ -2981,7 +2987,6 @@ int jfs_sync(void *arg)
complete(&jfsIOwait); complete(&jfsIOwait);
do { do {
DECLARE_WAITQUEUE(wq, current);
/* /*
* write each inode on the anonymous inode list * write each inode on the anonymous inode list
*/ */
...@@ -3030,12 +3035,20 @@ int jfs_sync(void *arg) ...@@ -3030,12 +3035,20 @@ int jfs_sync(void *arg)
} }
/* Add anon_list2 back to anon_list */ /* Add anon_list2 back to anon_list */
list_splice_init(&TxAnchor.anon_list2, &TxAnchor.anon_list); list_splice_init(&TxAnchor.anon_list2, &TxAnchor.anon_list);
if (current->flags & PF_FREEZE) {
TXN_UNLOCK();
refrigerator(PF_IOTHREAD);
} else {
DECLARE_WAITQUEUE(wq, current);
add_wait_queue(&jfs_sync_thread_wait, &wq); add_wait_queue(&jfs_sync_thread_wait, &wq);
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
TXN_UNLOCK(); TXN_UNLOCK();
schedule(); schedule();
current->state = TASK_RUNNING; current->state = TASK_RUNNING;
remove_wait_queue(&jfs_sync_thread_wait, &wq); remove_wait_queue(&jfs_sync_thread_wait, &wq);
}
} while (!jfs_stop_threads); } while (!jfs_stop_threads);
jFYI(1, ("jfs_sync being killed\n")); jFYI(1, ("jfs_sync being killed\n"));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment