[Suspend2][ 04/19] [Suspend2] Reset modules after invalidating an image.

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


Reset modules after using them to read an image header and invalidate it,
when the user puts noresume2 on the command line.

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

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

diff --git a/kernel/power/io.c b/kernel/power/io.c
index bfe4468..5c0acdd 100644
--- a/kernel/power/io.c
+++ b/kernel/power/io.c
@@ -111,3 +111,23 @@ void attempt_to_parse_resume_device2(voi
suspend_cleanup_usm();
}

+/* noresume_reset_modules
+ *
+ * Description: When we read the start of an image, modules (and especially the
+ * active writer) might need to reset data structures if we decide
+ * to invalidate the image rather than resuming from it.
+ */
+
+static void noresume_reset_modules(void)
+{
+ struct suspend_module_ops *this_filter;
+
+ list_for_each_entry(this_filter, &suspend_filters, type_list) {
+ if (this_filter->noresume_reset)
+ this_filter->noresume_reset();
+ }
+
+ if (suspend_active_writer && suspend_active_writer->noresume_reset)
+ suspend_active_writer->noresume_reset();
+}
+

--
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/