[ 05/10] [Suspend2] Get next module.

From: Nigel Cunningham
Date: Wed Feb 01 2006 - 06:40:27 EST



Given a current (possibly NULL) pointer to a module, find the next module
in the pipeline.

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

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

diff --git a/kernel/power/modules.c b/kernel/power/modules.c
index eee5678..a7c3c38 100644
--- a/kernel/power/modules.c
+++ b/kernel/power/modules.c
@@ -165,3 +165,23 @@ void suspend2_cleanup_modules(int finish
}
}
}
+
+/*
+ * get_next_filter
+ *
+ * Get the next filter in the pipeline.
+ */
+struct suspend_module_ops *get_next_filter(struct suspend_module_ops *filter_sought)
+{
+ struct suspend_module_ops *last_filter = NULL, *this_filter = NULL;
+
+ list_for_each_entry(this_filter, &suspend_filters, ops.filter.filter_list) {
+ if (this_filter->disabled)
+ continue;
+ if ((last_filter == filter_sought) || (!filter_sought))
+ return this_filter;
+ last_filter = this_filter;
+ }
+
+ return active_writer;
+}

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