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][ 27/32] [Suspend2] Init and cleanup routines for pageset i/o.
Date
Preparation and cleanup routines for doing I/O on a pageset.

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

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

diff --git a/kernel/power/suspend_block_io.c b/kernel/power/suspend_block_io.c
index c095eac..374a861 100644
--- a/kernel/power/suspend_block_io.c
+++ b/kernel/power/suspend_block_io.c
@@ -919,3 +919,40 @@ wait:
return 0;
}

+static int suspend_rw_init(int rw, int stream_number)
+{
+ suspend_extent_state_restore(&suspend_writer_posn,
+ &suspend_writer_posn_save[stream_number]);
+ current_stream = stream_number;
+
+ BUG_ON(!suspend_writer_posn.current_extent);
+
+ suspend_reset_io_stats();
+
+ readahead_index = readahead_submit_index = -1;
+
+ return 0;
+}
+
+static int suspend_rw_cleanup(int rw)
+{
+ if (rw == WRITE && current_stream == 2)
+ suspend_extent_state_save(&suspend_writer_posn,
+ &suspend_writer_posn_save[1]);
+
+ suspend_finish_all_io();
+
+ if (rw == READ) {
+ while (readahead_index != readahead_submit_index) {
+ suspend_cleanup_readahead(readahead_index);
+ readahead_index++;
+ if (readahead_index == MAX_OUTSTANDING_IO)
+ readahead_index = 0;
+ }
+ }
+
+ suspend_check_io_stats();
+
+ 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:14    [W:0.107 / U:4.120 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site