Re: [RFC] CryptoAPI & Compression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 19, 2005 at 04:51:56PM +0400, Artem B. Bityuckiy wrote:
> 
> JFFS2 wants the following from pcompress():
> 1. compressible data: compress it; the offered formerly algorithm works 
> just fine here.

Yes but the existing JFFS algorithm does a lot more than that.  It tries
to pack as much data as possible into the output buffer.

> 2. non-compressible data: do not compress it, leave it uncompressed; the 
> offered algorithm works fine here too - it returns an error.

If all you need is to compress what's compressible you don't need
pcompress at all.  You just need to call the normal compress method
with the input length clamped by the output buffer size.  If the
function returns OK then it's compressible, otherwise it isn't.

You can even do the existing JFFS loop this way too.
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux