lkml.org 
[lkml]   [2006]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[Suspend2][ 23/32] [Suspend2] Advance one page in the extent state.
Date
Advance one page in the list of devices and blocks (extent state).

Signed-off-by: Nigel Cunningham <nigel@suspend2.net>

kernel/power/suspend_block_io.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/kernel/power/suspend_block_io.c b/kernel/power/suspend_block_io.c
index fbce186..fdbbe4b 100644
--- a/kernel/power/suspend_block_io.c
+++ b/kernel/power/suspend_block_io.c
@@ -796,3 +796,22 @@ static int forward_extra_blocks(void)
return 0;
}

+static int forward_one_page(void)
+{
+ int at_start = (suspend_writer_posn.current_chain == -1);
+
+ /* Have to go forward one to ensure we're on the right chain,
+ * before we can know how many more blocks to skip.*/
+ suspend_extent_state_next(&suspend_writer_posn);
+
+ if (!at_start)
+ if (forward_extra_blocks())
+ return -ENODATA;
+
+ if (extra_page_forward) {
+ extra_page_forward = 0;
+ return forward_one_page();
+ }
+
+ return 0;
+}
--
Nigel Cunningham nigel at suspend2 dot net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-27 01:11    [W:0.099 / U:0.916 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site