lkml.org 
[lkml]   [2006]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[Suspend2][ 08/12] [Suspend2] Encryption resources needed.
Date
Add routines to return the amount of memory and header storage needed for
the encryption module.

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

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

diff --git a/kernel/power/encryption.c b/kernel/power/encryption.c
index 25db7ba..d12eb47 100644
--- a/kernel/power/encryption.c
+++ b/kernel/power/encryption.c
@@ -297,3 +297,23 @@ static int suspend_encrypt_print_debug_s
return len;
}

+/* encryption_memory_needed
+ *
+ * Description: Tell the caller how much memory we need to operate during
+ * suspend/resume.
+ * Returns: Unsigned long. Maximum number of bytes of memory required for
+ * operation.
+ */
+static unsigned long suspend_encrypt_memory_needed(void)
+{
+ return PAGE_SIZE;
+}
+
+static unsigned long suspend_encrypt_storage_needed(void)
+{
+ return 4 + strlen(suspend_encryptor_name) +
+ (suspend_encryptor_save_key_and_iv ?
+ (4 + strlen(suspend_encryptor_key) +
+ strlen(suspend_encryptor_iv)) : 0);
+}
+
--
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 07:14    [W:0.068 / U:1.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site