Messages in this thread Patch in this message |  | | | From | Nigel Cunningham <> | | Subject | [Suspend2][ 06/16] [Suspend2] Check if still keeping an existing image. | | Date | Tue, 27 Jun 2006 08:33:35 +1000 |
| |
Suspend2 supports a keep-the-image mode, which can be used when the contents of mounted filesystems don't change. Writeable storage can still be used, but it needs to be unmounted while suspending and remounted on resume.
Signed-off-by: Nigel Cunningham <nigel@suspend2.net>
kernel/power/suspend.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 06ab034..6457d75 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -488,3 +488,17 @@ static void free_metadata(void) free_dyn_pageflags(&in_use_map); } +static int check_still_keeping_image(void) +{ + if (test_action_state(SUSPEND_KEEP_IMAGE)) { + printk("Image already stored: powering down immediately."); + suspend_power_down(); + return 1; /* Just in case we're using S3 */ + } + + printk("Invalidating previous image.\n"); + suspend_active_writer->invalidate_image(); + + return 0; +} + -- Nigel Cunningham nigel at suspend2 dot net - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |