[PATCH 14/21] Hibernation: Use block extents for reading image

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Nigel Cunningham
Date: Wednesday, June 2, 2010 - 5:19 am

Switch from using swap map pages to using block extents for
knowing where the next page needs to be read from.

Signed-off-by: Nigel Cunningham <nigel@tuxonice.net>
---
 kernel/power/block_io.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/power/block_io.c b/kernel/power/block_io.c
index 7fabb0c..6745e77 100644
--- a/kernel/power/block_io.c
+++ b/kernel/power/block_io.c
@@ -332,7 +332,7 @@ int swap_read_page(void *buf, int sync)
 
 	if (!handle.cur)
 		return -EINVAL;
-	offset = handle.cur->entries[handle.k];
+	offset = hib_extent_next(&sector_extents);
 	if (!offset)
 		return -EFAULT;
 	error = hib_bio_read_page(offset, buf, sync);
@@ -341,7 +341,7 @@ int swap_read_page(void *buf, int sync)
 	if (++handle.k >= MAP_PAGE_ENTRIES) {
 		error = hib_wait_on_bio_chain();
 		handle.k = 0;
-		offset = handle.cur->next_swap;
+		offset = hib_extent_next(&sector_extents);
 		if (!offset)
 			release_swap_reader();
 		else if (!error)
-- 
1.7.0.4

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Nigel's current for-rafael queue, Nigel Cunningham, (Wed Jun 2, 5:18 am)
[PATCH 01/21] Hibernation: Swap iteration functions., Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 02/21] Hibernation: Move root_swap declaration., Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 03/21] Hibernation: Add mass swap allocation routine, Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 04/21] Hibernation: Switch to preallocating swap., Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 05/21] Hiberation: Fix speed display., Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 06/21] Hibernation: Generic extents support., Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 09/21] Hibernation: Stop passing bio_chain around, Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 10/21] Hibernation: Move block i/o fns to block_io.c, Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 11/21] Hibernation: Partial page I/O support., Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 12/21] Hibernation: Extent save/load routines., Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 14/21] Hibernation: Use block extents for reading image, Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 15/21] Remove first_sector from swap_map_handle, Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 16/21] Hibernation: Replace bio chain, Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 17/21] Hibernation: Remove swap_map_pages, Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 18/21] Hibernation: Remove wait_on_bio_chain result, Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 19/21] Hibernation: Prepare for handle.cur removal, Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 20/21] Hibernation: Remove swap_map structure, Nigel Cunningham, (Wed Jun 2, 5:19 am)
[PATCH 21/21] Hibernation: Remove now-empty routines., Nigel Cunningham, (Wed Jun 2, 5:19 am)
Re: Nigel's current for-rafael queue, Pavel Machek, (Mon Aug 2, 11:55 pm)
Re: Nigel's current for-rafael queue, Nigel Cunningham, (Tue Aug 3, 12:00 am)