diff options
| author | Patrick Mochel <mochel@osdl.org> | 2003-08-04 03:14:08 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2003-08-04 03:14:08 -0700 |
| commit | 5847d6c19bbbf2aa5c67504729f9b84750e57fa3 (patch) | |
| tree | 0bb7ae02665867ee08a1cd8ceef24aff5c766c24 | |
| parent | 45a8d2842d6dee53ba5130734abfc602856efdaa (diff) | |
[power] Minor swsusp cleanups.
- Call blk_run_queues() from do_software_suspend() directly, instead of
wrapping it in helper function.
- Get rid of ominous compiler warning.
- Change BUG_ON(in_interrupt()) to might_sleep() in software_suspend(), so
we still get back trace, but don't actually BUG().
Orginally from Pavel Machek.
| -rw-r--r-- | kernel/power/swsusp.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index 60337de05682..3dfb07e05a2d 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c @@ -181,17 +181,6 @@ static __inline__ int fill_suspend_header(struct suspend_header *sh) return 0; } -/* - * This is our sync function. With this solution we probably won't sleep - * but that should not be a problem since tasks are stopped.. - */ - -static inline void do_suspend_sync(void) -{ - blk_run_queues(); -#warning This might be broken. We need to somehow wait for data to reach the disk -} - /* We memorize in swapfile_used what swap devices are used for suspension */ #define SWAPFILE_UNUSED 0 #define SWAPFILE_SUSPEND 1 /* This is the suspending device */ @@ -764,13 +753,10 @@ static void do_software_suspend(void) free_some_memory(); - /* No need to invalidate any vfsmnt list -- they will be valid after resume, anyway. - * - * We sync here -- so you have consistent filesystem state when things go wrong. - * -- so that noone writes to disk after we do atomic copy of data. + /* No need to invalidate any vfsmnt list -- + * they will be valid after resume, anyway. */ - PRINTK("Syncing disks before copy\n"); - do_suspend_sync(); + blk_run_queues(); /* Save state of all device drivers, and stop them. */ if(drivers_suspend()==0) @@ -801,7 +787,7 @@ void software_suspend(void) return; software_suspend_enabled = 0; - BUG_ON(in_interrupt()); + might_sleep(); do_software_suspend(); } |
