[Suspend2][ 04/13] [Suspend2] Utility function for testing storage managers.

From: Nigel Cunningham
Date: Tue Jun 27 2006 - 00:56:55 EST


Provide a means whereby a developer (via a proc entry) can test a storage
manager. Invoke the prepare, activate, deactivate and cleanup routines in
that order.

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

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

diff --git a/kernel/power/storage.c b/kernel/power/storage.c
index 71b8c02..c007a8e 100644
--- a/kernel/power/storage.c
+++ b/kernel/power/storage.c
@@ -130,3 +130,21 @@ int suspend_deactivate_storage(int force
return 0;
}

+#ifdef CONFIG_PM_DEBUG
+static void storage_manager_simulate(void)
+{
+ printk("--- Storage manager simulate ---\n");
+ suspend_prepare_usm();
+ schedule();
+ printk("--- Activate storage 1 ---\n");
+ suspend_activate_storage(1);
+ schedule();
+ printk("--- Deactivate storage 1 ---\n");
+ suspend_deactivate_storage(1);
+ schedule();
+ printk("--- Cleanup usm ---\n");
+ suspend_cleanup_usm();
+ schedule();
+ printk("--- Storage manager simulate ends ---\n");
+}
+#endif

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