@@ -2,7 +2,7 @@
config ZRAM
tristate "Compressed RAM block device support"
depends on SWAP && SYSFS
- depends on CRYPTO_LZO || CRYPTO_ZSTD || CRYPTO_LZ4 || CRYPTO_LZ4HC || CRYPTO_842
+ depends on CRYPTO_LZO || CRYPTO_ZSTD || CRYPTO_LZ4 || CRYPTO_LZ4HC || CRYPTO_842 || CRYPTO_DEFLATE
select ZSMALLOC
help
Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
@@ -20,6 +20,10 @@ choice
default ZRAM_DEF_COMP_LZORLE
depends on ZRAM
+config ZRAM_DEF_COMP_DEFLATE
+ bool "Deflate"
+ depends on CRYPTO_DEFLATE
+
config ZRAM_DEF_COMP_LZORLE
bool "lzo-rle"
depends on CRYPTO_LZO
@@ -48,6 +52,7 @@ endchoice
config ZRAM_DEF_COMP
string
+ default "deflate" if ZRAM_DEF_COMP_DEFLATE
default "lzo-rle" if ZRAM_DEF_COMP_LZORLE
default "zstd" if ZRAM_DEF_COMP_ZSTD
default "lz4" if ZRAM_DEF_COMP_LZ4
@@ -16,6 +16,9 @@
#include "zcomp.h"
static const char * const backends[] = {
+#if IS_ENABLED(CONFIG_CRYPTO_DEFLATE)
+ "deflate",
+#endif
#if IS_ENABLED(CONFIG_CRYPTO_LZO)
"lzo",
"lzo-rle",
Add deflate compressor support, also it is prepare for unifying the default compressor compressor for zram and zswap. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- drivers/block/zram/Kconfig | 7 ++++++- drivers/block/zram/zcomp.c | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-)