lz4: add experimental support for lz4 compression

* IMPORTANT HIGHLY EXPERIMENTAL * only use for experimental
testing of lz4 compression.  LZ4 compressed filesystems produced
by this code will be guaranteed to become unreadable in a couple of
days!

This code produces "legacy" LZ4 format compression - this is the
format supported by the LZ4 kernel code currently in linux-next.

It is currently unclear whether the kernel code expects the LZ4
magic to be present - if so this has to be explictly added as it is not
generated by the LZ4 calls.

More importantly, it is unclear whether in the long term the
kernel code will continue to use the "legacy" format or move to the
more complicated newer format.

Due to this it is important to mark these LZ4 compressed streams as
using "legacy" format, to enable the code to distinquish between
"legacy" format and the newer format, in the event the kernel code
moves to the newer format.

This could be achieved by having two compression types, LZ4 == legacy, and
LZ4_XXX for any newer format, but this is messy, and makes an
unnecessary distinction (at the level of the compression type) between
the formats.

A better option is to make comp_opts (compression options) mandatory
for LZ4, and this comp_opt structure will encode the version of the
format, which will be used in the event the legacy format is superseded
in the kernel.

Currently this code lacks setting a comp_opts structure.  In the
near future this code will be added, and the presence of the
comp_opts structure in the filesystem will become mandatory - and
any filesystems generated by this code will become unreadable.  You have
been warned!

Checking into lz4 branch for this reason!

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
5 files changed
tree: 0ff6bff48337a77b886d00e4719ad4df8bc3f2df
  1. kernel/
  2. kernel-2.4/
  3. squashfs-tools/
  4. README