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

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

 



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

 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 [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