mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] crypto: compress - Add pcomp interface
Date: Thu, 15 Jan 2009 14:05:26 +1100	[thread overview]
Message-ID: <20090115030526.GA27726@gondor.apana.org.au> (raw)
In-Reply-To: <Pine.LNX.4.64.0901141528010.31703@vixen.sonytel.be>

On Wed, Jan 14, 2009 at 04:01:34PM +0100, Geert Uytterhoeven wrote:
>
> It's used by the pr_*() macros in <linux/kernel.h>.
> 
> Since commit d091c2f58ba32029495a933b721e8e02fbd12caa ("Add 'pr_fmt()' format
> modifier to pr_xyz macros."), this is the new way to have a common prefix in
> all printed output.

But you don't actually print anything out in the module :)

> For compatibility with crypto_comp, we also need an alloc function for both
> compress and decompress, so that makes 3 alloc functions.

Couldn't crypto_comp just call both alloc functions? I don't see
why we need a third function.

> > 1) We know what the user wants to do without every algorithm
> > reinventing their own signalling for it;
> 
> I guess you want to use the flags to indicate compress/decompress/both?
> Unfortunately I'm still struggling to fully understand the type/mask handling,
> so I would appreciate it if you could give me a hint how to handle that.

No, I mean that whether you want compression or decompression
is signified by the which function you're calling.  If you want
to do both then you call both.

> I assume "length" is the size of the passed params, so the algorithms can
> return -EINVAL if they're passed the wrong size?

Well with the netlink parameters these can have variable lengths
depending on how many parameters the user supplies.

> > > +static inline struct crypto_pcomp *crypto_alloc_pcomp(const char *alg_name,
> > > +						      u32 type, u32 mask)
> > > +{
> > > +	type &= ~CRYPTO_ALG_TYPE_MASK;
> > > +	type |= CRYPTO_ALG_TYPE_PCOMPRESS;
> > > +	mask |= CRYPTO_ALG_TYPE_MASK;
> > > +
> > > +	return __crypto_pcomp_cast(crypto_alloc_base(alg_name, type, mask));
> > > +}
> > 
> > That's the old way to allocate tfm's which won't work since pcomp
> > is using the new type API.  You should do it the way that shash
> > does it.
> 
> I tried to do this, but stumbled across a dependency problem: as
> crypto_alloc_tfm() needs a pointer to crypto_pcomp_type(), crypto_alloc_pcomp()
> can no longer be static inline, and must be moved to crypto/pcompress.c.

Ah yes because crypto_comp is one of the original types that's
still built-in.  Because there are so few compression users and
algorithms (exactly 3 if you include null compression), I think
we can dispense with the compatibility stuff altogether since
we'll likely rip out fairly soon anyway.

So just create the new type, readd deflate using the new type
alongside the existing deflate algorithm.  The system is capable
of supporting two algorithms of the same name with different types.

Then once the other algorithm (lzo) is taken care of and all the
users are converted I'll just kill the old type and algorithms.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2009-01-15  3:05 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-13 15:59 [PATCH/RFC 0/7] Partial (de)compression API Geert Uytterhoeven
2009-01-13 15:59 ` [PATCH] crypto: compress - Add pcomp interface Geert Uytterhoeven
2009-01-13 15:59   ` [PATCH] crypto: testmgr - Add support for the " Geert Uytterhoeven
2009-01-13 15:59     ` [PATCH] crypto: api - Add type init function to crypto_tfm Geert Uytterhoeven
2009-01-13 15:59       ` [PATCH] crypto: api - Export pcomp through comp Geert Uytterhoeven
2009-01-13 15:59         ` [PATCH] crypto: deflate - switch to pcomp Geert Uytterhoeven
2009-01-13 15:59           ` [PATCH] crypto: testmgr - swith deflate test " Geert Uytterhoeven
2009-01-13 15:59             ` [PATCH] squashfs: Make SquashFS 4 use the new pcomp crypto interface Geert Uytterhoeven
2009-01-14  3:16   ` [PATCH] crypto: compress - Add pcomp interface Herbert Xu
2009-01-14 15:01     ` Geert Uytterhoeven
2009-01-15  3:05       ` Herbert Xu [this message]
2009-01-15 10:54         ` Geert Uytterhoeven
2009-01-16  4:27           ` Herbert Xu
2009-02-05 16:24         ` Geert Uytterhoeven
2009-02-10  6:18           ` Herbert Xu
2009-02-12 15:19             ` Geert Uytterhoeven
2009-02-19  4:08               ` Herbert Xu
2009-02-19  9:12                 ` Geert Uytterhoeven
2009-02-19 10:42                   ` Herbert Xu
2009-02-23 17:32                     ` Geert Uytterhoeven
2009-02-25  2:56                       ` Herbert Xu
2009-02-25 13:26                         ` Geert Uytterhoeven
2009-01-14 16:45   ` Jaswinder Singh Rajput
2009-01-14 16:54     ` Geert Uytterhoeven
2009-01-14 17:08       ` Jaswinder Singh Rajput

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=20090115030526.GA27726@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=Geert.Uytterhoeven@sonycom.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®