aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/swap.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2010-05-01 17:52:02 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2010-05-10 17:08:17 -0400
commitd3c1b24c50e8b2bbc840322caf26c7eada594d21 (patch)
treeb411a494ec6328e217b9bfa5b619f5aa2003968a /kernel/power/swap.c
parent6a727b43be8b005609e893a80af980808012cfdb (diff)
PM / Hibernate: Snapshot cleanup
Remove support of reads with offset. This means snapshot_read/write_next now does not accept count parameter. It allows to clean up the functions and snapshot handle which no longer needs to care about offsets. /dev/snapshot handler is converted to simple_{read_from,write_to}_buffer which take care of offsets. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'kernel/power/swap.c')
-rw-r--r--kernel/power/swap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 66824d71983a..7f2a17e4067b 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -431,7 +431,7 @@ static int save_image(struct swap_map_handle *handle,
431 bio = NULL; 431 bio = NULL;
432 do_gettimeofday(&start); 432 do_gettimeofday(&start);
433 while (1) { 433 while (1) {
434 ret = snapshot_read_next(snapshot, PAGE_SIZE); 434 ret = snapshot_read_next(snapshot);
435 if (ret <= 0) 435 if (ret <= 0)
436 break; 436 break;
437 ret = swap_write_page(handle, data_of(*snapshot), &bio); 437 ret = swap_write_page(handle, data_of(*snapshot), &bio);
@@ -492,7 +492,7 @@ int swsusp_write(unsigned int flags)
492 return error; 492 return error;
493 } 493 }
494 memset(&snapshot, 0, sizeof(struct snapshot_handle)); 494 memset(&snapshot, 0, sizeof(struct snapshot_handle));
495 error = snapshot_read_next(&snapshot, PAGE_SIZE); 495 error = snapshot_read_next(&snapshot);
496 if (error < PAGE_SIZE) { 496 if (error < PAGE_SIZE) {
497 if (error >= 0) 497 if (error >= 0)
498 error = -EFAULT; 498 error = -EFAULT;
@@ -615,7 +615,7 @@ static int load_image(struct swap_map_handle *handle,
615 bio = NULL; 615 bio = NULL;
616 do_gettimeofday(&start); 616 do_gettimeofday(&start);
617 for ( ; ; ) { 617 for ( ; ; ) {
618 error = snapshot_write_next(snapshot, PAGE_SIZE); 618 error = snapshot_write_next(snapshot);
619 if (error <= 0) 619 if (error <= 0)
620 break; 620 break;
621 error = swap_read_page(handle, data_of(*snapshot), &bio); 621 error = swap_read_page(handle, data_of(*snapshot), &bio);
@@ -660,7 +660,7 @@ int swsusp_read(unsigned int *flags_p)
660 *flags_p = swsusp_header->flags; 660 *flags_p = swsusp_header->flags;
661 661
662 memset(&snapshot, 0, sizeof(struct snapshot_handle)); 662 memset(&snapshot, 0, sizeof(struct snapshot_handle));
663 error = snapshot_write_next(&snapshot, PAGE_SIZE); 663 error = snapshot_write_next(&snapshot);
664 if (error < PAGE_SIZE) 664 if (error < PAGE_SIZE)
665 return error < 0 ? error : -EFAULT; 665 return error < 0 ? error : -EFAULT;
666 header = (struct swsusp_info *)data_of(snapshot); 666 header = (struct swsusp_info *)data_of(snapshot);