[Suspend2][ 07/28] [Suspend2] Reset swapwriter when not resuming.

From: Nigel Cunningham
Date: Mon Jun 26 2006 - 18:47:45 EST


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@xxxxxxxxxxxx>

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