[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4CA3ADED.6090908@tuxonice.net>
Date: Thu, 30 Sep 2010 07:21:49 +1000
From: Nigel Cunningham <nigel@...onice.net>
To: "Rafael J. Wysocki" <rjw@...k.pl>
CC: Linux-pm mailing list <linux-pm@...ts.linux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC][PATCH] PM / Hibernate: Modify signature used to mark swap
Hi.
On 30/09/10 07:13, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki<rjw@...k.pl>
> Subject: PM / Hibernate: Modify signature used to mark swap
>
> Since we are adding compression to the kernel's hibernate code,
> change signature used by it to mark swap spaces, so that earlier
> kernels don't attempt to restore compressed images they cannot
> handle.
>
> Signed-off-by: Rafael J. Wysocki<rjw@...k.pl>
> ---
> kernel/power/swap.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> Index: linux-2.6/kernel/power/swap.c
> ===================================================================
> --- linux-2.6.orig/kernel/power/swap.c
> +++ linux-2.6/kernel/power/swap.c
> @@ -29,7 +29,7 @@
>
> #include "power.h"
>
> -#define SWSUSP_SIG "S1SUSPEND"
> +#define HIBERNATE_SIG "LINHIB0001"
>
> /*
> * The swap map is a data structure used for keeping track of each page
> @@ -195,7 +195,7 @@ static int mark_swapfiles(struct swap_ma
> if (!memcmp("SWAP-SPACE",swsusp_header->sig, 10) ||
> !memcmp("SWAPSPACE2",swsusp_header->sig, 10)) {
> memcpy(swsusp_header->orig_sig,swsusp_header->sig, 10);
if no compression
> - memcpy(swsusp_header->sig,SWSUSP_SIG, 10);
else
> + memcpy(swsusp_header->sig, HIBERNATE_SIG, 10);
??
> swsusp_header->image = handle->first_sector;
> swsusp_header->flags = flags;
> error = hib_bio_write_page(swsusp_resume_block,
> @@ -916,7 +916,7 @@ int swsusp_check(void)
> if (error)
> goto put;
>
> - if (!memcmp(SWSUSP_SIG, swsusp_header->sig, 10)) {
> + if (!memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)) {
Reset the signature in either case?
> memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10);
> /* Reset swap signature now */
> error = hib_bio_write_page(swsusp_resume_block,
>
Regards,
Nigel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists