lkml.org 
[lkml]   [2006]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[Suspend2][ 07/28] [Suspend2] Reset swapwriter when not resuming.
Date
Reset the device info and close bdevs when we set up when preparing to
resume. This might happen because of a problem, or because noresume2 was
given on the command line and we needed first to invalidate the image.

Signed-off-by: Nigel Cunningham <nigel@suspend2.net>

kernel/power/suspend_swap.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/kernel/power/suspend_swap.c b/kernel/power/suspend_swap.c
index 66bb556..a014103 100644
--- a/kernel/power/suspend_swap.c
+++ b/kernel/power/suspend_swap.c
@@ -233,3 +233,13 @@ static int try_to_parse_resume_device(ch
return 0;
}

+/*
+ * If we have read part of the image, we might have filled memory with
+ * data that should be zeroed out.
+ */
+static void swapwriter_noresume_reset(void)
+{
+ memset((char *) &devinfo, 0, sizeof(devinfo));
+ close_bdevs();
+}
+
--
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/

\
 
 \ /
  Last update: 2006-06-27 00:51    [W:0.419 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site