Messages in this thread Patch in this message | | | From | Nigel Cunningham <> | Subject | [Suspend2][ 07/28] [Suspend2] Reset swapwriter when not resuming. | Date | Tue, 27 Jun 2006 08:41:29 +1000 |
| |
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/
| |