* [PATCH] zram: break the strict dependency from lzo
@ 2020-10-22 16:11 Rui Salvaterra
2020-10-22 21:19 ` Rui Salvaterra
0 siblings, 1 reply; 2+ messages in thread
From: Rui Salvaterra @ 2020-10-22 16:11 UTC (permalink / raw)
To: minchan, ngupta, sergey.senozhatsky.work
Cc: linux-kernel, linux-block, 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.
Additionally, drop the explicit dependency from CRYPTO, as it's implied by the
selection of the algorithms themselves.
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
---
drivers/block/zram/Kconfig | 8 ++++++--
drivers/block/zram/zcomp.c | 2 ++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/block/zram/Kconfig b/drivers/block/zram/Kconfig
index fe7a4b7d30cf..2641b86f8677 100644
--- a/drivers/block/zram/Kconfig
+++ b/drivers/block/zram/Kconfig
@@ -1,8 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
config ZRAM
tristate "Compressed RAM block device support"
- depends on BLOCK && SYSFS && ZSMALLOC && CRYPTO
- select CRYPTO_LZO
+ depends on BLOCK && SYSFS && ZSMALLOC
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
diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
index 33e3b76c4fa9..052aa3f65514 100644
--- a/drivers/block/zram/zcomp.c
+++ b/drivers/block/zram/zcomp.c
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] zram: break the strict dependency from lzo
2020-10-22 16:11 [PATCH] zram: break the strict dependency from lzo Rui Salvaterra
@ 2020-10-22 21:19 ` Rui Salvaterra
0 siblings, 0 replies; 2+ messages in thread
From: Rui Salvaterra @ 2020-10-22 21:19 UTC (permalink / raw)
To: minchan, ngupta, sergey.senozhatsky.work; +Cc: linux-kernel, linux-block
Oops, this is broken, I'll send a v2 soon.
On Thu, 22 Oct 2020 at 17:11, Rui Salvaterra <rsalvaterra@gmail.com> wrote:
>
> 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.
>
> Additionally, drop the explicit dependency from CRYPTO, as it's implied by the
> selection of the algorithms themselves.
>
> Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
> ---
> drivers/block/zram/Kconfig | 8 ++++++--
> drivers/block/zram/zcomp.c | 2 ++
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/block/zram/Kconfig b/drivers/block/zram/Kconfig
> index fe7a4b7d30cf..2641b86f8677 100644
> --- a/drivers/block/zram/Kconfig
> +++ b/drivers/block/zram/Kconfig
> @@ -1,8 +1,7 @@
> # SPDX-License-Identifier: GPL-2.0
> config ZRAM
> tristate "Compressed RAM block device support"
> - depends on BLOCK && SYSFS && ZSMALLOC && CRYPTO
> - select CRYPTO_LZO
> + depends on BLOCK && SYSFS && ZSMALLOC
> 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
> diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
> index 33e3b76c4fa9..052aa3f65514 100644
> --- a/drivers/block/zram/zcomp.c
> +++ b/drivers/block/zram/zcomp.c
> @@ -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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-22 21:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-22 16:11 [PATCH] zram: break the strict dependency from lzo Rui Salvaterra
2020-10-22 21:19 ` Rui Salvaterra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).