From cb3bee0369bc9316e47f4ad95a3c33f4e0d50a06 Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Fri, 9 Mar 2018 18:51:07 +0800 Subject: pstore: Use crypto compress API In the pstore compression part, we use zlib/lzo/lz4/lz4hc/842 compression algorithm API to implement pstore compression backends. But there are many repeat codes in these implementations. This patch uses crypto compress API to simplify these codes. 1) rewrite allocate_buf_for_compression, free_buf_for_compression, pstore_compress, pstore_decompress functions using crypto compress API. 2) drop compress, decompress, allocate, free functions in pstore_zbackend, and add zbufsize function to get each different compress buffer size. 3) use late_initcall to call ramoops_init later, to make sure the crypto subsystem has already initialized. 4) use 'unsigned int' type instead of 'size_t' in pstore_compress, pstore_decompress functions' length arguments. 5) rename 'zlib' to 'deflate' to follow the crypto API's name convention. Signed-off-by: Geliang Tang [kees: tweaked error messages on allocation failures and Kconfig help] Signed-off-by: Kees Cook --- fs/pstore/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/pstore/ram.c') diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 7125b398d312..49b2bc114868 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -938,7 +938,7 @@ static int __init ramoops_init(void) ramoops_register_dummy(); return platform_driver_register(&ramoops_driver); } -postcore_initcall(ramoops_init); +late_initcall(ramoops_init); static void __exit ramoops_exit(void) { -- cgit v1.2.3