[Suspend2][ 07/32] [Suspend2] Wait for bio completion.

From: Nigel Cunningham
Date: Mon Jun 26 2006 - 19:15:51 EST


Submit any outstanding batched I/O, kick kblockd, io_schedule() and see
what we can cleanup.

Signed-off-by: Nigel Cunningham <nigel@xxxxxxxxxxxx>

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

diff --git a/kernel/power/suspend_block_io.c b/kernel/power/suspend_block_io.c
index cfff687..6f8b29e 100644
--- a/kernel/power/suspend_block_io.c
+++ b/kernel/power/suspend_block_io.c
@@ -310,3 +310,26 @@ static void suspend_cleanup_some_complet
spin_unlock_irqrestore(&ioinfo_ready_lock, flags);
}

+/* do_bio_wait
+ *
+ * Actions taken when we want some I/O to get run.
+ *
+ * Submit any I/O that's batched up (if we're not already doing
+ * that, unplug queues, schedule and clean up whatever we can.
+ */
+static void do_bio_wait(int caller)
+{
+ int num_submitted = 0;
+
+ nr_schedule_calls[caller]++;
+
+ /* Don't want to wait on I/O we haven't submitted! */
+ num_submitted = submit_batched();
+
+ kblockd_flush();
+
+ io_schedule();
+
+ suspend_cleanup_some_completed_io();
+}
+

--
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/