[Suspend2][ 06/16] [Suspend2] Check if still keeping an existing image.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>

 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux