OSDN Git Service

zram: Move default compression algorithm choice to Kconfig
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / drivers / block / zram / Kconfig
index cb53957..e4f781a 100644 (file)
@@ -1,7 +1,8 @@
 config ZRAM
        tristate "Compressed RAM block device support"
-       depends on BLOCK && SYSFS && ZSMALLOC && CRYPTO
-       select CRYPTO_LZO
+       depends on BLOCK && SYSFS && CRYPTO
+       select CRYPTO_LZ4
+       select ZPOOL
        default n
        help
          Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
@@ -35,3 +36,38 @@ config ZRAM_MEMORY_TRACKING
          /sys/kernel/debug/zram/zramX/block_state.
 
          See Documentation/blockdev/zram.txt for more information.
+
+config ZRAM_DEFAULT_COMP_ALGORITHM
+       string "Default ZRAM compression algorithm"
+       default "lz4"
+
+if ZRAM
+
+choice
+       prompt "Default zRAM compressed memory allocator"
+       default ZRAM_DEFAULT_ZSMALLOC
+       help
+         Select the compressed memory allocator that will be used by default
+         for all devices.
+
+       config ZRAM_DEFAULT_ZBUD
+               bool "zbud"
+               select ZBUD
+
+       config ZRAM_DEFAULT_Z3FOLD
+               bool "z3fold"
+               select Z3FOLD
+
+       config ZRAM_DEFAULT_ZSMALLOC
+               bool "zsmalloc"
+               select ZSMALLOC
+
+endchoice
+
+config ZRAM_DEFAULT_POOL
+       string
+       default "zbud" if ZRAM_DEFAULT_ZBUD
+       default "z3fold" if ZRAM_DEFAULT_Z3FOLD
+       default "zsmalloc" if ZRAM_DEFAULT_ZSMALLOC
+
+endif