From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Minchan Kim <minchan@kernel.org>, Nitin Gupta <ngupta@vflare.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Stephan Mueller <smueller@chronox.de>,
linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH v4 8/8] zram: enable contextless compression alg in zram
Date: Thu, 15 Oct 2015 09:45:22 +0900 [thread overview]
Message-ID: <20151015004522.GA4900@js1304-P5Q-DELUXE> (raw)
In-Reply-To: <20151015002903.GB1735@swordfish>
On Thu, Oct 15, 2015 at 09:29:03AM +0900, Sergey Senozhatsky wrote:
> Hi,
>
> On (10/14/15 16:38), Joonsoo Kim wrote:
> [..]
> > static const char * const backends[] = {
> > "lzo",
> > -#ifdef CONFIG_ZRAM_LZ4_COMPRESS
> > "lz4",
> > -#endif
> > NULL
> > };
> >
> > static const char *find_backend(const char *compress)
> > {
> > - int i = 0;
> > - while (backends[i]) {
> > - if (sysfs_streq(compress, backends[i]) &&
> > - crypto_has_comp(backends[i], 0, 0))
> > - break;
> > - i++;
> > - }
> > - return backends[i];
> > + if (crypto_has_comp(compress, 0, 0))
> > + return compress;
> > +
> > + return NULL;
> > }
> >
> > static void zcomp_strm_free(struct zcomp *comp, struct zcomp_strm *zstrm)
> > @@ -277,6 +271,9 @@ ssize_t zcomp_available_show(const char *comp, char *buf)
> > int i = 0;
> >
> > while (backends[i]) {
> > + if (!crypto_has_comp(backends[i], 0, 0))
> > + continue;
> > +
>
> hm... this sort of looks a bit `unnatural' to me. we have two _independent_
> sets -- what zram supports and what crypto supports. that's why you have
> to do extra work and consult crypto. can we return back the old scheme:
> use ifdef CONFIG in backends, but replace CONFIG_ZRAM with CONFIG_CRYPTO?
>
> e.g.
>
> static const char * const backends[] = {
> "lzo",
> #ifdef CONFIG_CRYPTO_LZ4
> "lz4",
> #endif
> NULL
> };
>
>
> so you can remove `crypto_has_comp(backends[i], 0, 0)' from
> zcomp_available_show(), because zram will support *only* what
> crypto supports.
Hello, Sergey.
Okay. I will change it in next spin.
Anyway, now I noticed that crypto_has_comp() is not proper API to
check contextless compression algorithm. I will change it, too.
Thanks.
next prev parent reply other threads:[~2015-10-15 0:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 7:38 [PATCH v4 0/8] zram: introduce contextless compression API and use it on zram Joonsoo Kim
2015-10-14 7:38 ` [PATCH v4 1/8] crypto/compress: introduce contextless compression and remove unused pcomp Joonsoo Kim
2015-10-14 7:38 ` [PATCH v4 2/8] crypto/lzo: support contextless compression API Joonsoo Kim
2015-10-14 7:38 ` [PATCH v4 3/8] crypto/lz4: support contextless compressiona API Joonsoo Kim
2015-10-14 8:38 ` kbuild test robot
2015-10-14 7:38 ` [PATCH v4 4/8] crypto/deflate: support contextless compression API Joonsoo Kim
2015-10-14 8:33 ` kbuild test robot
2015-10-14 10:08 ` kbuild test robot
2015-10-14 10:26 ` kbuild test robot
2015-10-14 7:38 ` [PATCH v4 5/8] zram: make stream find and release functions static Joonsoo Kim
2015-10-14 7:38 ` [PATCH v4 6/8] zram: pass zstrm down to decompression path Joonsoo Kim
2015-10-14 7:38 ` [PATCH v4 7/8] zram: use crypto contextless compression API to (de)compress Joonsoo Kim
2015-10-15 0:38 ` Sergey Senozhatsky
2015-10-15 1:07 ` Joonsoo Kim
2015-10-15 1:53 ` Sergey Senozhatsky
2015-10-14 7:38 ` [PATCH v4 8/8] zram: enable contextless compression alg in zram Joonsoo Kim
2015-10-15 0:29 ` Sergey Senozhatsky
2015-10-15 0:45 ` Joonsoo Kim [this message]
2015-10-15 2:05 ` Sergey Senozhatsky
2015-10-15 2:48 ` Joonsoo Kim
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=20151015004522.GA4900@js1304-P5Q-DELUXE \
--to=iamjoonsoo.kim@lge.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=ngupta@vflare.org \
--cc=sergey.senozhatsky.work@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox