aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/pstore/Kconfig19
-rw-r--r--fs/pstore/platform.c22
2 files changed, 21 insertions, 20 deletions
diff --git a/fs/pstore/Kconfig b/fs/pstore/Kconfig
index 49b407eab846..09c19ef91526 100644
--- a/fs/pstore/Kconfig
+++ b/fs/pstore/Kconfig
@@ -1,5 +1,6 @@
1config PSTORE 1config PSTORE
2 tristate "Persistent store support" 2 tristate "Persistent store support"
3 select CRYPTO if PSTORE_COMPRESS
3 default n 4 default n
4 help 5 help
5 This option enables generic access to platform level 6 This option enables generic access to platform level
@@ -13,7 +14,7 @@ config PSTORE
13 say N. 14 say N.
14 15
15config PSTORE_DEFLATE_COMPRESS 16config PSTORE_DEFLATE_COMPRESS
16 bool "DEFLATE (ZLIB) compression" 17 tristate "DEFLATE (ZLIB) compression"
17 default y 18 default y
18 depends on PSTORE 19 depends on PSTORE
19 select CRYPTO_DEFLATE 20 select CRYPTO_DEFLATE
@@ -22,21 +23,21 @@ config PSTORE_DEFLATE_COMPRESS
22 algorithm support. 23 algorithm support.
23 24
24config PSTORE_LZO_COMPRESS 25config PSTORE_LZO_COMPRESS
25 bool "LZO compression" 26 tristate "LZO compression"
26 depends on PSTORE 27 depends on PSTORE
27 select CRYPTO_LZO 28 select CRYPTO_LZO
28 help 29 help
29 This option enables LZO compression algorithm support. 30 This option enables LZO compression algorithm support.
30 31
31config PSTORE_LZ4_COMPRESS 32config PSTORE_LZ4_COMPRESS
32 bool "LZ4 compression" 33 tristate "LZ4 compression"
33 depends on PSTORE 34 depends on PSTORE
34 select CRYPTO_LZ4 35 select CRYPTO_LZ4
35 help 36 help
36 This option enables LZ4 compression algorithm support. 37 This option enables LZ4 compression algorithm support.
37 38
38config PSTORE_LZ4HC_COMPRESS 39config PSTORE_LZ4HC_COMPRESS
39 bool "LZ4HC compression" 40 tristate "LZ4HC compression"
40 depends on PSTORE 41 depends on PSTORE
41 select CRYPTO_LZ4HC 42 select CRYPTO_LZ4HC
42 help 43 help
@@ -70,19 +71,19 @@ choice
70 The default compression algorithm is deflate. 71 The default compression algorithm is deflate.
71 72
72 config PSTORE_DEFLATE_COMPRESS_DEFAULT 73 config PSTORE_DEFLATE_COMPRESS_DEFAULT
73 bool "deflate" if PSTORE_DEFLATE_COMPRESS=y 74 bool "deflate" if PSTORE_DEFLATE_COMPRESS
74 75
75 config PSTORE_LZO_COMPRESS_DEFAULT 76 config PSTORE_LZO_COMPRESS_DEFAULT
76 bool "lzo" if PSTORE_LZO_COMPRESS=y 77 bool "lzo" if PSTORE_LZO_COMPRESS
77 78
78 config PSTORE_LZ4_COMPRESS_DEFAULT 79 config PSTORE_LZ4_COMPRESS_DEFAULT
79 bool "lz4" if PSTORE_LZ4_COMPRESS=y 80 bool "lz4" if PSTORE_LZ4_COMPRESS
80 81
81 config PSTORE_LZ4HC_COMPRESS_DEFAULT 82 config PSTORE_LZ4HC_COMPRESS_DEFAULT
82 bool "lz4hc" if PSTORE_LZ4HC_COMPRESS=y 83 bool "lz4hc" if PSTORE_LZ4HC_COMPRESS
83 84
84 config PSTORE_842_COMPRESS_DEFAULT 85 config PSTORE_842_COMPRESS_DEFAULT
85 bool "842" if PSTORE_842_COMPRESS=y 86 bool "842" if PSTORE_842_COMPRESS
86 87
87endchoice 88endchoice
88 89
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 42e111b3bd0c..1143ef351c58 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -28,10 +28,10 @@
28#include <linux/console.h> 28#include <linux/console.h>
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/pstore.h> 30#include <linux/pstore.h>
31#ifdef CONFIG_PSTORE_LZO_COMPRESS 31#if IS_ENABLED(CONFIG_PSTORE_LZO_COMPRESS)
32#include <linux/lzo.h> 32#include <linux/lzo.h>
33#endif 33#endif
34#if defined(CONFIG_PSTORE_LZ4_COMPRESS) || defined(CONFIG_PSTORE_LZ4HC_COMPRESS) 34#if IS_ENABLED(CONFIG_PSTORE_LZ4_COMPRESS) || IS_ENABLED(CONFIG_PSTORE_LZ4HC_COMPRESS)
35#include <linux/lz4.h> 35#include <linux/lz4.h>
36#endif 36#endif
37#include <linux/crypto.h> 37#include <linux/crypto.h>
@@ -142,7 +142,7 @@ bool pstore_cannot_block_path(enum kmsg_dump_reason reason)
142} 142}
143EXPORT_SYMBOL_GPL(pstore_cannot_block_path); 143EXPORT_SYMBOL_GPL(pstore_cannot_block_path);
144 144
145#ifdef CONFIG_PSTORE_DEFLATE_COMPRESS 145#if IS_ENABLED(CONFIG_PSTORE_DEFLATE_COMPRESS)
146static int zbufsize_deflate(size_t size) 146static int zbufsize_deflate(size_t size)
147{ 147{
148 size_t cmpr; 148 size_t cmpr;
@@ -171,21 +171,21 @@ static int zbufsize_deflate(size_t size)
171} 171}
172#endif 172#endif
173 173
174#ifdef CONFIG_PSTORE_LZO_COMPRESS 174#if IS_ENABLED(CONFIG_PSTORE_LZO_COMPRESS)
175static int zbufsize_lzo(size_t size) 175static int zbufsize_lzo(size_t size)
176{ 176{
177 return lzo1x_worst_compress(size); 177 return lzo1x_worst_compress(size);
178} 178}
179#endif 179#endif
180 180
181#if defined(CONFIG_PSTORE_LZ4_COMPRESS) || defined(CONFIG_PSTORE_LZ4HC_COMPRESS) 181#if IS_ENABLED(CONFIG_PSTORE_LZ4_COMPRESS) || IS_ENABLED(CONFIG_PSTORE_LZ4HC_COMPRESS)
182static int zbufsize_lz4(size_t size) 182static int zbufsize_lz4(size_t size)
183{ 183{
184 return LZ4_compressBound(size); 184 return LZ4_compressBound(size);
185} 185}
186#endif 186#endif
187 187
188#ifdef CONFIG_PSTORE_842_COMPRESS 188#if IS_ENABLED(CONFIG_PSTORE_842_COMPRESS)
189static int zbufsize_842(size_t size) 189static int zbufsize_842(size_t size)
190{ 190{
191 return size; 191 return size;
@@ -195,31 +195,31 @@ static int zbufsize_842(size_t size)
195static const struct pstore_zbackend *zbackend __ro_after_init; 195static const struct pstore_zbackend *zbackend __ro_after_init;
196 196
197static const struct pstore_zbackend zbackends[] = { 197static const struct pstore_zbackend zbackends[] = {
198#ifdef CONFIG_PSTORE_DEFLATE_COMPRESS 198#if IS_ENABLED(CONFIG_PSTORE_DEFLATE_COMPRESS)
199 { 199 {
200 .zbufsize = zbufsize_deflate, 200 .zbufsize = zbufsize_deflate,
201 .name = "deflate", 201 .name = "deflate",
202 }, 202 },
203#endif 203#endif
204#ifdef CONFIG_PSTORE_LZO_COMPRESS 204#if IS_ENABLED(CONFIG_PSTORE_LZO_COMPRESS)
205 { 205 {
206 .zbufsize = zbufsize_lzo, 206 .zbufsize = zbufsize_lzo,
207 .name = "lzo", 207 .name = "lzo",
208 }, 208 },
209#endif 209#endif
210#ifdef CONFIG_PSTORE_LZ4_COMPRESS 210#if IS_ENABLED(CONFIG_PSTORE_LZ4_COMPRESS)
211 { 211 {
212 .zbufsize = zbufsize_lz4, 212 .zbufsize = zbufsize_lz4,
213 .name = "lz4", 213 .name = "lz4",
214 }, 214 },
215#endif 215#endif
216#ifdef CONFIG_PSTORE_LZ4HC_COMPRESS 216#if IS_ENABLED(CONFIG_PSTORE_LZ4HC_COMPRESS)
217 { 217 {
218 .zbufsize = zbufsize_lz4, 218 .zbufsize = zbufsize_lz4,
219 .name = "lz4hc", 219 .name = "lz4hc",
220 }, 220 },
221#endif 221#endif
222#ifdef CONFIG_PSTORE_842_COMPRESS 222#if IS_ENABLED(CONFIG_PSTORE_842_COMPRESS)
223 { 223 {
224 .zbufsize = zbufsize_842, 224 .zbufsize = zbufsize_842,
225 .name = "842", 225 .name = "842",