btrfs: prepare incompat flags for more compression methods

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: add LZ4 compression method

Adjusted a few defines to compile. The on-stack context allocation is
disabled and either LZ4_compress64kCtx or LZ4_compressCtx must be used.

Origin: http://lz4.googlecode.com/svn/trunk
Revision: 88

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: lz4: add wrapper for context size estimation

Currently 16K for 32bit and 64bit.

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: lz4: add wrapper functions and enable it

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: add lz4hc incompat bits

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: add lz4hc files

SVN version: 88

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: enable lz4hc build

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: add lz4hc wrapper

Signed-off-by: David Sterba <dsterba@suse.cz>
btrfs: lz4: enhance chunk format (v1)

V0 is the old format:
* 4byte header
* sequence of chunks
 * chunk: 4 bytes of compressed length + bytes

V1 compresses a chunk by 128k at once:
* 4 byte header, encoding format version in LSB highest 4 bits, the rest
  is overall length

Signed-off-by: David Sterba <dsterba@suse.cz>
Reduce duplicate code in lz4_wrapper.c

Add generic functions for compress_pages and alloc that accept an argument to
enable high compression, and replace the lz4/lz4hc variants of both with
wrappers for these.
btrfs: invalidate data to be read after vmap, flush data written before vunmap.

In lz4_wrapper.c, invalidate address ranges to be read after vmap, and flush
any that have been written before vunmap. Fixes lz4-compressed files sometimes
showing incorrect contents.
Return errors on failure in lz4 compress/decompress.
WIP: handle partial read in lz4_decompress_biovec.

Handle biovec which doesn't cover the entire uncompressed extent by filling
gaps with newly-allocated pages, freed after decompression is complete.
btrfs: fix lz4_decompress

Correctly handle sizes and return values in lz4_decompress. Compressed inline
extents should work correctly now.
btrfs: Decompress directly to output page in lz4_decompress.

Instead of using the workspace buffer for decompression and then copying
to the destination page, map the destination page and decompress to it
directly. If an offset is given for the desired portion of the data, memmove
to place it at the start of the page.
zen: add git maintenance documentation for btrfs-lz4
Merge branch '3.8/btrfs-lz4' into 3.8/master