From 9a154d9d95b7b9845938242f5c62505b3cab5bcd Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Wed, 6 Dec 2006 20:34:12 -0800 Subject: [PATCH] swsusp: add resume_offset command line parameter Add the kernel command line parameter "resume_offset=" allowing us to specify the offset, in units, from the beginning of the partition pointed to by the "resume=" parameter at which the swap header is located. This offset can be determined, for example, by an application using the FIBMAP ioctl to obtain the swap header's block number for given file. [akpm@osdl.org: we don't know what type sector_t is] Signed-off-by: Rafael J. Wysocki Cc: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/power/disk.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'kernel/power/disk.c') diff --git a/kernel/power/disk.c b/kernel/power/disk.c index b1fb7866b0b3..d79feeb45459 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c @@ -27,6 +27,7 @@ static int noresume = 0; char resume_file[256] = CONFIG_PM_STD_PARTITION; dev_t swsusp_resume_device; +sector_t swsusp_resume_block; /** * power_down - Shut machine down for hibernate. @@ -423,6 +424,19 @@ static int __init resume_setup(char *str) return 1; } +static int __init resume_offset_setup(char *str) +{ + unsigned long long offset; + + if (noresume) + return 1; + + if (sscanf(str, "%llu", &offset) == 1) + swsusp_resume_block = offset; + + return 1; +} + static int __init noresume_setup(char *str) { noresume = 1; @@ -430,4 +444,5 @@ static int __init noresume_setup(char *str) } __setup("noresume", noresume_setup); +__setup("resume_offset=", resume_offset_setup); __setup("resume=", resume_setup); -- cgit v1.2.2