Skip to contentSkip to conversation

zram: break the strict dependency from lzo

PATCH Superseded Rui Salvaterra 1 participant 2 messages Oct 22, 2020 – Oct 23, 2020

Subsystems (2)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 zram: break the strict dependency from lzo

There's nothing special about zram and lzo. It works just fine without it, so as long as at least one of the other supported compression algorithms is selected.

---
v2: fix the dependency on CRYPTO.

 drivers/block/zram/Kconfig | 6 +++++-
 drivers/block/zram/zcomp.c | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/block/zram/Kconfig +5 -1
index fe7a4b7d30cf..14b2b098d662 100644
@@ -2,7 +2,6 @@
 config ZRAM
 	tristate "Compressed RAM block device support"
 	depends on BLOCK && SYSFS && ZSMALLOC && CRYPTO
-	select CRYPTO_LZO
 	help
 	  Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
 	  Pages written to these disks are compressed and stored in memory
@@ -37,3 +36,8 @@ config ZRAM_MEMORY_TRACKING
 	  /sys/kernel/debug/zram/zramX/block_state.
 
 	  See Documentation/admin-guide/blockdev/zram.rst for more information.
+
+config ZRAM_AUTOSEL_ALGO
+	def_bool y
+	depends on ZRAM && !(CRYPTO_LZ4 || CRYPTO_LZ4HC || CRYPTO_842 || CRYPTO_ZSTD)
+	select CRYPTO_LZO
drivers/block/zram/zcomp.c +2 -0
index 33e3b76c4fa9..052aa3f65514 100644
@@ -15,8 +15,10 @@
 #include "zcomp.h"
 
 static const char * const backends[] = {
+#if IS_ENABLED(CONFIG_CRYPTO_LZO)
 	"lzo",
 	"lzo-rle",
+#endif
 #if IS_ENABLED(CONFIG_CRYPTO_LZ4)
 	"lz4",
 #endif
Signature · 1 line
2.28.0
#1 lore raw

Sigh. Please disregard this too, I also need to fix the default selection. I'll send a new version against 5.10-rc1, next week.

Quoted 52 lines · Rui Salvaterra

There's nothing special about zram and lzo. It works just fine without it, so as long as at least one of the other supported compression algorithms is selected.

---
v2: fix the dependency on CRYPTO.

 drivers/block/zram/Kconfig | 6 +++++-
 drivers/block/zram/zcomp.c | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/block/zram/Kconfig +5 -1
index fe7a4b7d30cf..14b2b098d662 100644
@@ -2,7 +2,6 @@
 config ZRAM
        tristate "Compressed RAM block device support"
        depends on BLOCK && SYSFS && ZSMALLOC && CRYPTO
-       select CRYPTO_LZO
        help
          Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
          Pages written to these disks are compressed and stored in memory
@@ -37,3 +36,8 @@ config ZRAM_MEMORY_TRACKING
          /sys/kernel/debug/zram/zramX/block_state.
 
          See Documentation/admin-guide/blockdev/zram.rst for more information.
+
+config ZRAM_AUTOSEL_ALGO
+       def_bool y
+       depends on ZRAM && !(CRYPTO_LZ4 || CRYPTO_LZ4HC || CRYPTO_842 || CRYPTO_ZSTD)
+       select CRYPTO_LZO
drivers/block/zram/zcomp.c +2 -1
index 33e3b76c4fa9..052aa3f65514 100644
@@ -15,8 +15,10 @@
 #include "zcomp.h"
 
 static const char * const backends[] = {
+#if IS_ENABLED(CONFIG_CRYPTO_LZO)
        "lzo",
        "lzo-rle",
+#endif
 #if IS_ENABLED(CONFIG_CRYPTO_LZ4)
        "lz4",
 #endif
--

2.28.0