aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/disk.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2006-12-06 23:34:12 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:27 -0500
commit9a154d9d95b7b9845938242f5c62505b3cab5bcd (patch)
treefd3c51434298b139671f5accd42ab112a310555c /kernel/power/disk.c
parent3aef83e0ef1ffb8ea3bea97be46821a45c952173 (diff)
[PATCH] swsusp: add resume_offset command line parameter
Add the kernel command line parameter "resume_offset=" allowing us to specify the offset, in <PAGE_SIZE> 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 <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/power/disk.c')
-rw-r--r--kernel/power/disk.c15
1 files changed, 15 insertions, 0 deletions
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 @@
27static int noresume = 0; 27static int noresume = 0;
28char resume_file[256] = CONFIG_PM_STD_PARTITION; 28char resume_file[256] = CONFIG_PM_STD_PARTITION;
29dev_t swsusp_resume_device; 29dev_t swsusp_resume_device;
30sector_t swsusp_resume_block;
30 31
31/** 32/**
32 * power_down - Shut machine down for hibernate. 33 * power_down - Shut machine down for hibernate.
@@ -423,6 +424,19 @@ static int __init resume_setup(char *str)
423 return 1; 424 return 1;
424} 425}
425 426
427static int __init resume_offset_setup(char *str)
428{
429 unsigned long long offset;
430
431 if (noresume)
432 return 1;
433
434 if (sscanf(str, "%llu", &offset) == 1)
435 swsusp_resume_block = offset;
436
437 return 1;
438}
439
426static int __init noresume_setup(char *str) 440static int __init noresume_setup(char *str)
427{ 441{
428 noresume = 1; 442 noresume = 1;
@@ -430,4 +444,5 @@ static int __init noresume_setup(char *str)
430} 444}
431 445
432__setup("noresume", noresume_setup); 446__setup("noresume", noresume_setup);
447__setup("resume_offset=", resume_offset_setup);
433__setup("resume=", resume_setup); 448__setup("resume=", resume_setup);