diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2006-01-06 03:13:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:40 -0500 |
commit | 7088a5c00103ef48782d6c359cd12b13a10666e6 (patch) | |
tree | b731c8af48e00c0ec88bbe57b6b2a2c1ec20fbde /kernel/power/disk.c | |
parent | f2d97f02961e8b1f8a24befb88ab0e5c886586ff (diff) |
[PATCH] swsusp: introduce the swap map structure
This patch introduces the swap map structure that can be used by swsusp for
keeping tracks of data pages written to the swap. The structure itself is
described in a comment within the patch.
The overall idea is to reduce the amount of metadata written to the swap and
to write and read the image pages sequentially, in a file-alike way. This
makes the swap-handling part of swsusp fairly independent of its
snapshot-handling part and will hopefully allow us to completely separate
these two parts in the future.
This patch is needed to remove the suspend image size limit imposed by the
limited size of the swsusp_info structure, which is essential for x86-64
systems with more than 512 MB of RAM.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@suse.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.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 4d944b281b28..76a5131b0e80 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
@@ -25,9 +25,9 @@ | |||
25 | extern suspend_disk_method_t pm_disk_mode; | 25 | extern suspend_disk_method_t pm_disk_mode; |
26 | 26 | ||
27 | extern int swsusp_suspend(void); | 27 | extern int swsusp_suspend(void); |
28 | extern int swsusp_write(void); | 28 | extern int swsusp_write(struct pbe *pblist, unsigned int nr_pages); |
29 | extern int swsusp_check(void); | 29 | extern int swsusp_check(void); |
30 | extern int swsusp_read(void); | 30 | extern int swsusp_read(struct pbe **pblist_ptr); |
31 | extern void swsusp_close(void); | 31 | extern void swsusp_close(void); |
32 | extern int swsusp_resume(void); | 32 | extern int swsusp_resume(void); |
33 | 33 | ||
@@ -176,7 +176,7 @@ int pm_suspend_disk(void) | |||
176 | if (in_suspend) { | 176 | if (in_suspend) { |
177 | device_resume(); | 177 | device_resume(); |
178 | pr_debug("PM: writing image.\n"); | 178 | pr_debug("PM: writing image.\n"); |
179 | error = swsusp_write(); | 179 | error = swsusp_write(pagedir_nosave, nr_copy_pages); |
180 | if (!error) | 180 | if (!error) |
181 | power_down(pm_disk_mode); | 181 | power_down(pm_disk_mode); |
182 | else { | 182 | else { |
@@ -247,7 +247,7 @@ static int software_resume(void) | |||
247 | 247 | ||
248 | pr_debug("PM: Reading swsusp image.\n"); | 248 | pr_debug("PM: Reading swsusp image.\n"); |
249 | 249 | ||
250 | if ((error = swsusp_read())) { | 250 | if ((error = swsusp_read(&pagedir_nosave))) { |
251 | swsusp_free(); | 251 | swsusp_free(); |
252 | goto Thaw; | 252 | goto Thaw; |
253 | } | 253 | } |