mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nigel Cunningham <nigel@suspend2.net>
To: linux-kernel@vger.kernel.org
Subject: [Suspend2][ 07/19] [Suspend2] Cleanup modules after doing I/O on a portion of the image.
Date: Tue, 27 Jun 2006 08:36:22 +1000	[thread overview]
Message-ID: <20060626223620.4219.88435.stgit@nigel.suspend2.net> (raw)
In-Reply-To: <20060626223557.4219.53030.stgit@nigel.suspend2.net>

Flush any pending I/O (writes only), and cleanup modules using in doing the
I/O.

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

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

diff --git a/kernel/power/io.c b/kernel/power/io.c
index 401789d..be13f42 100644
--- a/kernel/power/io.c
+++ b/kernel/power/io.c
@@ -206,3 +206,38 @@ static int rw_init_modules(int rw, int w
 	return 0;
 }
 
+/*
+ * rw_cleanup_modules
+ *
+ * Cleanup components after reading or writing a set of pages.
+ * Only the writer may fail.
+ */
+static int rw_cleanup_modules(int rw)
+{
+	struct suspend_module_ops *this_module;
+	int result = 0;
+
+	/* Cleanup other modules */
+	list_for_each_entry(this_module, &suspend_modules, module_list) {
+		if (this_module->disabled)
+			continue;
+		if ((this_module->type == FILTER_MODULE) ||
+		    (this_module->type == WRITER_MODULE))
+			continue;
+		if (this_module->rw_cleanup)
+			result |= this_module->rw_cleanup(rw);
+	}
+
+	/* Flush data and cleanup */
+	list_for_each_entry(this_module, &suspend_filters, type_list) {
+		if (this_module->disabled)
+			continue;
+		if (this_module->rw_cleanup)
+			result |= this_module->rw_cleanup(rw);
+	}
+
+	result |= suspend_active_writer->rw_cleanup(rw);
+
+	return result;
+}
+

--
Nigel Cunningham		nigel at suspend2 dot net

  parent reply	other threads:[~2006-06-26 23:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26 22:35 [Suspend2][ 00/19] Highlevel I/O routines Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 01/19] [Suspend2] Core io.c header Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 02/19] [Suspend2] Attempt to parse resume device Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 03/19] [Suspend2] Attempt to parse resume device (wrapped) Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 04/19] [Suspend2] Reset modules after invalidating an image Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 05/19] [Suspend2] Fill the suspend header fields Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 06/19] [Suspend2] Initialise modules before doing I/O Nigel Cunningham
2006-06-26 22:36 ` Nigel Cunningham [this message]
2006-06-26 22:36 ` [Suspend2][ 08/19] [Suspend2] I/O main loop Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 09/19] [Suspend2] Write a pageset Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 10/19] [Suspend2] Read a portion of the image from storage Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 11/19] [Suspend2] Write module configurations in an image header Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 12/19] [Suspend2] Read module configs from " Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 13/19] [Suspend2] Write " Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 14/19] [Suspend2] Sanity check " Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 15/19] [Suspend2] Core of code for reading pageset1 Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 16/19] [Suspend2] Read pageset1 Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 17/19] [Suspend2] Get image_exists data Nigel Cunningham
2006-06-26 22:36 ` [Suspend2][ 18/19] [Suspend2] Read pageset2 Nigel Cunningham
2006-06-26 22:37 ` [Suspend2][ 19/19] [Suspend2] I/O header file Nigel Cunningham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060626223620.4219.88435.stgit@nigel.suspend2.net \
    --to=nigel@suspend2.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome