From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Joonsoo Kim <js1304@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Stephan Mueller <smueller@chronox.de>,
Joonsoo Kim <iamjoonsoo.kim@lge.com>
Subject: Re: [PATCH v2 4/8] crypto/lz4hc: support decompress_noctx
Date: Thu, 27 Aug 2015 10:57:30 +0900 [thread overview]
Message-ID: <20150827015730.GC1545@swordfish> (raw)
In-Reply-To: <1440052504-15442-5-git-send-email-iamjoonsoo.kim@lge.com>
On (08/20/15 15:35), Joonsoo Kim wrote:
>
> lz4hc's decompression doesn't requires any scratch buffer so
> it doesn't need tfm context. Hence, it can support
> crypto compression noctx API and this patch implements it.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> ---
> crypto/lz4hc.c | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/crypto/lz4hc.c b/crypto/lz4hc.c
> index bcf0baa..a529620 100644
> --- a/crypto/lz4hc.c
> +++ b/crypto/lz4hc.c
> @@ -76,6 +76,21 @@ static int lz4hc_decompress_crypto(struct crypto_tfm *tfm, const u8 *src,
> return err;
> }
>
> +static int lz4hc_decompress_noctx(const u8 *src, unsigned int slen,
> + u8 *dst, unsigned int *dlen)
> +{
> + int err;
> + size_t tmp_len = *dlen;
> + size_t __slen = slen;
> +
> + err = lz4_decompress_unknownoutputsize(src, __slen, dst, &tmp_len);
> + if (err < 0)
> + return -EINVAL;
> +
> + *dlen = tmp_len;
> + return err;
> +}
> +
same,
static int lz4hc_decompress_noctx(const u8 *src, unsigned int slen,
u8 *dst, unsigned int *dlen)
{
return lz4hc_decompress_crypto(NULL, ....);
}
?
-ss
> static struct crypto_alg alg_lz4hc = {
> .cra_name = "lz4hc",
> .cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
> @@ -88,7 +103,7 @@ static struct crypto_alg alg_lz4hc = {
> .coa_compress = lz4hc_compress_crypto,
> .coa_decompress = lz4hc_decompress_crypto,
> .coa_compress_noctx = NULL,
> - .coa_decompress_noctx = NULL } }
> + .coa_decompress_noctx = lz4hc_decompress_noctx } }
> };
>
> static int __init lz4hc_mod_init(void)
> --
> 1.9.1
>
next prev parent reply other threads:[~2015-08-27 1:57 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-20 6:34 [PATCH v2 0/8] zram: introduce crypto compress noctx API and use it on zram Joonsoo Kim
2015-08-20 6:34 ` [PATCH v2 1/8] crypto: support (de)compression API that doesn't require tfm object Joonsoo Kim
2015-08-20 6:47 ` Herbert Xu
2015-08-20 7:52 ` Joonsoo Kim
2015-08-20 7:50 ` Herbert Xu
2015-08-20 8:05 ` Joonsoo Kim
2015-08-20 6:34 ` [PATCH v2 2/8] crypto/lzo: support decompress_noctx Joonsoo Kim
2015-08-27 1:54 ` Sergey Senozhatsky
2015-08-20 6:34 ` [PATCH v2 3/8] crypyo/lz4: " Joonsoo Kim
2015-08-27 1:56 ` Sergey Senozhatsky
2015-08-20 6:35 ` [PATCH v2 4/8] crypto/lz4hc: " Joonsoo Kim
2015-08-27 1:57 ` Sergey Senozhatsky [this message]
2015-08-20 6:35 ` [PATCH v2 5/8] crypto/842: " Joonsoo Kim
2015-08-20 6:35 ` [PATCH v2 6/8] zram: change zcomp_compress interface Joonsoo Kim
2015-08-27 2:14 ` Sergey Senozhatsky
2015-08-20 6:35 ` [PATCH v2 7/8] zram: use crypto API for compression Joonsoo Kim
2015-08-27 4:01 ` Sergey Senozhatsky
2015-08-28 12:02 ` [PATCH 0/2] prepare zram for crypto api-powered zcomp Sergey Senozhatsky
2015-08-28 12:02 ` [PATCH 1/2] zram: make stream find and release functions static Sergey Senozhatsky
2015-08-28 12:02 ` [PATCH 2/2] zram: pass zstrm down to decompression path Sergey Senozhatsky
2015-09-01 1:22 ` [PATCH 0/2] prepare zram for crypto api-powered zcomp Minchan Kim
2015-09-01 1:41 ` Sergey Senozhatsky
2015-09-01 2:06 ` Minchan Kim
2015-09-01 2:12 ` Sergey Senozhatsky
2015-09-07 5:32 ` Joonsoo Kim
2015-08-20 6:35 ` [PATCH v2 8/8] zram: use decompress_noctx Joonsoo Kim
2015-08-27 4:07 ` Sergey Senozhatsky
2015-08-27 5:47 ` Sergey Senozhatsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150827015730.GC1545@swordfish \
--to=sergey.senozhatsky.work@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=iamjoonsoo.kim@lge.com \
--cc=js1304@gmail.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=ngupta@vflare.org \
--cc=smueller@chronox.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.