[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180321074948.GA2746@jagdpanzerIV>
Date: Wed, 21 Mar 2018 16:49:48 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Maninder Singh <maninder1.s@...sung.com>
Cc: herbert@...dor.apana.org.au, davem@...emloft.net,
minchan@...nel.org, ngupta@...are.org,
sergey.senozhatsky.work@...il.com, keescook@...omium.org,
anton@...msg.org, ccross@...roid.com, tony.luck@...el.com,
akpm@...ux-foundation.org, colin.king@...onical.com,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
pankaj.m@...sung.com, a.sahrawat@...sung.com, v.narang@...sung.com
Subject: Re: [PATCH 1/1] lz4: Implement lz4 with dynamic offset length.
On (03/21/18 10:10), Maninder Singh wrote:
[..]
> +static struct crypto_alg alg_lz4_dyn = {
> + .cra_name = "lz4_dyn",
> + .cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
> + .cra_ctxsize = sizeof(struct lz4_ctx),
> + .cra_module = THIS_MODULE,
> + .cra_list = LIST_HEAD_INIT(alg_lz4_dyn.cra_list),
> + .cra_init = lz4_init,
> + .cra_exit = lz4_exit,
> + .cra_u = { .compress = {
> + .coa_compress = lz4_compress_crypto_dynamic,
> + .coa_decompress = lz4_decompress_crypto_dynamic } }
> +};
[..]
> diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
> index 4ed0a78..5bc5aab 100644
> --- a/drivers/block/zram/zcomp.c
> +++ b/drivers/block/zram/zcomp.c
> @@ -17,11 +17,15 @@
> #include <linux/crypto.h>
>
> #include "zcomp.h"
> +#define KB (1 << 10)
>
> static const char * const backends[] = {
> "lzo",
> #if IS_ENABLED(CONFIG_CRYPTO_LZ4)
> "lz4",
> +#if (PAGE_SIZE < (32 * KB))
> + "lz4_dyn",
> +#endif
This is not the list of supported algorithms. It's the list of
recommended algorithms. You can configure zram to use any of
available and known to Crypto API algorithms. Including lz4_dyn
on PAGE_SIZE > 32K systems.
-ss
Powered by blists - more mailing lists