Loading fs/pstore/Kconfig +14 −3 Original line number Diff line number Diff line Loading @@ -50,12 +50,19 @@ config PSTORE_842_COMPRESS help This option enables 842 compression algorithm support. config PSTORE_ZSTD_COMPRESS bool "zstd compression" depends on PSTORE select CRYPTO_ZSTD help This option enables zstd compression algorithm support. config PSTORE_COMPRESS def_bool y depends on PSTORE depends on PSTORE_DEFLATE_COMPRESS || PSTORE_LZO_COMPRESS || \ PSTORE_LZ4_COMPRESS || PSTORE_LZ4HC_COMPRESS || \ PSTORE_842_COMPRESS PSTORE_842_COMPRESS || PSTORE_ZSTD_COMPRESS choice prompt "Default pstore compression algorithm" Loading @@ -65,8 +72,8 @@ choice This change be changed at boot with "pstore.compress=..." on the kernel command line. Currently, pstore has support for 5 compression algorithms: deflate, lzo, lz4, lz4hc and 842. Currently, pstore has support for 6 compression algorithms: deflate, lzo, lz4, lz4hc, 842 and zstd. The default compression algorithm is deflate. Loading @@ -85,6 +92,9 @@ choice config PSTORE_842_COMPRESS_DEFAULT bool "842" if PSTORE_842_COMPRESS config PSTORE_ZSTD_COMPRESS_DEFAULT bool "zstd" if PSTORE_ZSTD_COMPRESS endchoice config PSTORE_COMPRESS_DEFAULT Loading @@ -95,6 +105,7 @@ config PSTORE_COMPRESS_DEFAULT default "lz4" if PSTORE_LZ4_COMPRESS_DEFAULT default "lz4hc" if PSTORE_LZ4HC_COMPRESS_DEFAULT default "842" if PSTORE_842_COMPRESS_DEFAULT default "zstd" if PSTORE_ZSTD_COMPRESS_DEFAULT config PSTORE_CONSOLE bool "Log kernel console messages" Loading fs/pstore/platform.c +16 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,9 @@ #if IS_ENABLED(CONFIG_PSTORE_LZ4_COMPRESS) || IS_ENABLED(CONFIG_PSTORE_LZ4HC_COMPRESS) #include <linux/lz4.h> #endif #if IS_ENABLED(CONFIG_PSTORE_ZSTD_COMPRESS) #include <linux/zstd.h> #endif #include <linux/crypto.h> #include <linux/string.h> #include <linux/timer.h> Loading Loading @@ -192,6 +195,13 @@ static int zbufsize_842(size_t size) } #endif #if IS_ENABLED(CONFIG_PSTORE_ZSTD_COMPRESS) static int zbufsize_zstd(size_t size) { return ZSTD_compressBound(size); } #endif static const struct pstore_zbackend *zbackend __ro_after_init; static const struct pstore_zbackend zbackends[] = { Loading Loading @@ -224,6 +234,12 @@ static const struct pstore_zbackend zbackends[] = { .zbufsize = zbufsize_842, .name = "842", }, #endif #if IS_ENABLED(CONFIG_PSTORE_ZSTD_COMPRESS) { .zbufsize = zbufsize_zstd, .name = "zstd", }, #endif { } }; Loading Loading
fs/pstore/Kconfig +14 −3 Original line number Diff line number Diff line Loading @@ -50,12 +50,19 @@ config PSTORE_842_COMPRESS help This option enables 842 compression algorithm support. config PSTORE_ZSTD_COMPRESS bool "zstd compression" depends on PSTORE select CRYPTO_ZSTD help This option enables zstd compression algorithm support. config PSTORE_COMPRESS def_bool y depends on PSTORE depends on PSTORE_DEFLATE_COMPRESS || PSTORE_LZO_COMPRESS || \ PSTORE_LZ4_COMPRESS || PSTORE_LZ4HC_COMPRESS || \ PSTORE_842_COMPRESS PSTORE_842_COMPRESS || PSTORE_ZSTD_COMPRESS choice prompt "Default pstore compression algorithm" Loading @@ -65,8 +72,8 @@ choice This change be changed at boot with "pstore.compress=..." on the kernel command line. Currently, pstore has support for 5 compression algorithms: deflate, lzo, lz4, lz4hc and 842. Currently, pstore has support for 6 compression algorithms: deflate, lzo, lz4, lz4hc, 842 and zstd. The default compression algorithm is deflate. Loading @@ -85,6 +92,9 @@ choice config PSTORE_842_COMPRESS_DEFAULT bool "842" if PSTORE_842_COMPRESS config PSTORE_ZSTD_COMPRESS_DEFAULT bool "zstd" if PSTORE_ZSTD_COMPRESS endchoice config PSTORE_COMPRESS_DEFAULT Loading @@ -95,6 +105,7 @@ config PSTORE_COMPRESS_DEFAULT default "lz4" if PSTORE_LZ4_COMPRESS_DEFAULT default "lz4hc" if PSTORE_LZ4HC_COMPRESS_DEFAULT default "842" if PSTORE_842_COMPRESS_DEFAULT default "zstd" if PSTORE_ZSTD_COMPRESS_DEFAULT config PSTORE_CONSOLE bool "Log kernel console messages" Loading
fs/pstore/platform.c +16 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,9 @@ #if IS_ENABLED(CONFIG_PSTORE_LZ4_COMPRESS) || IS_ENABLED(CONFIG_PSTORE_LZ4HC_COMPRESS) #include <linux/lz4.h> #endif #if IS_ENABLED(CONFIG_PSTORE_ZSTD_COMPRESS) #include <linux/zstd.h> #endif #include <linux/crypto.h> #include <linux/string.h> #include <linux/timer.h> Loading Loading @@ -192,6 +195,13 @@ static int zbufsize_842(size_t size) } #endif #if IS_ENABLED(CONFIG_PSTORE_ZSTD_COMPRESS) static int zbufsize_zstd(size_t size) { return ZSTD_compressBound(size); } #endif static const struct pstore_zbackend *zbackend __ro_after_init; static const struct pstore_zbackend zbackends[] = { Loading Loading @@ -224,6 +234,12 @@ static const struct pstore_zbackend zbackends[] = { .zbufsize = zbufsize_842, .name = "842", }, #endif #if IS_ENABLED(CONFIG_PSTORE_ZSTD_COMPRESS) { .zbufsize = zbufsize_zstd, .name = "zstd", }, #endif { } }; Loading