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][ 23/35] [Suspend2] Filewriter storage needed.
Date
Return the amount of space in the image header required by the filewriter.

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

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

diff --git a/kernel/power/suspend_file.c b/kernel/power/suspend_file.c
index a4871c7..4f9d6f5 100644
--- a/kernel/power/suspend_file.c
+++ b/kernel/power/suspend_file.c
@@ -737,3 +737,23 @@ static int filewriter_print_debug_stats(
return len;
}

+/*
+ * Storage needed
+ *
+ * Returns amount of space in the image header required
+ * for the filewriter's data.
+ *
+ * We ensure the space is allocated, but actually save the
+ * data from write_header_init and therefore don't also define a
+ * save_config_info routine.
+ */
+static unsigned long filewriter_storage_needed(void)
+{
+ return sig_size + strlen(filewriter_target) + 1 +
+ 3 * sizeof(struct extent_iterate_saved_state) +
+ sizeof(devinfo) +
+ sizeof(struct extent_chain) - 2 * sizeof(void *) +
+ (2 * sizeof(unsigned long) *
+ (block_chain.allocs - block_chain.frees));
+}
+
--
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:04    [W:0.122 / U:2.344 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site