lkml.org 
[lkml]   [2006]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[Suspend2][ 28/35] [Suspend2] Test filewriter target value helper.
Date
The helper called either when the user echoes a new value into
filewriter_target, or when resume2= is checked on boot or when it is reset.

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

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

diff --git a/kernel/power/suspend_file.c b/kernel/power/suspend_file.c
index 2e19aae..9947323 100644
--- a/kernel/power/suspend_file.c
+++ b/kernel/power/suspend_file.c
@@ -828,3 +828,33 @@ static void filewriter_set_resume2(void)
suspend_attempt_to_parse_resume_device();
}

+static int __test_filewriter_target(char *target, int resume_time)
+{
+ filewriter_get_target_info(target, 0, resume_time);
+ if (filewriter_signature_op(GET_IMAGE_EXISTS) > -1) {
+ printk(name_suspend "Filewriter: File signature found.\n");
+ if (!resume_time)
+ filewriter_set_resume2();
+
+ suspend_bio_ops.set_devinfo(&devinfo);
+ suspend_writer_posn.chains = &block_chain;
+ suspend_writer_posn.num_chains = 1;
+
+ set_suspend_state(SUSPEND_CAN_SUSPEND);
+ return 0;
+ }
+
+ clear_suspend_state(SUSPEND_CAN_SUSPEND);
+
+ if (*target)
+ printk(name_suspend
+ "Filewriter: Sorry. No signature found at %s.\n",
+ target);
+ else
+ if (!resume_time)
+ printk(name_suspend
+ "Filewriter: Sorry. Target is not set for suspending.\n");
+
+ return 1;
+}
+
--
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-27 01:01    [W:0.133 / U:51.612 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site