* grub-core/fs/zfs/zfs_lz4.c: New file.

* grub-core/fs/zfs/zfs.c: Tie up lz4 decompression.
This commit is contained in:
Massimo Maggi 2013-07-14 14:12:58 +02:00 committed by Vladimir 'phcoder' Serbinenko
parent 776bdce291
commit 038016f48a
6 changed files with 334 additions and 2 deletions

View file

@ -153,11 +153,13 @@ ZAP_LEAF_ENTRY(zap_leaf_phys_t *l, int bs, int idx)
/*
* Decompression Entry - lzjb
* Decompression Entry - lzjb & lz4
*/
extern grub_err_t lzjb_decompress (void *, void *, grub_size_t, grub_size_t);
extern grub_err_t lz4_decompress (void *, void *, grub_size_t, grub_size_t);
typedef grub_err_t zfs_decomp_func_t (void *s_start, void *d_start,
grub_size_t s_len, grub_size_t d_len);
typedef struct decomp_entry
@ -278,7 +280,7 @@ grub_crypto_cipher_handle_t (*grub_zfs_load_key) (const struct grub_zfs_key *key
*/
#define MAX_SUPPORTED_FEATURE_STRLEN 50
static const char *spa_feature_names[] = {
"max.test:feat1",NULL
"org.illumos:lz4_compress",NULL
};
static int
@ -344,6 +346,7 @@ static decomp_entry_t decomp_table[ZIO_COMPRESS_FUNCTIONS] = {
{"gzip-8", zlib_decompress}, /* ZIO_COMPRESS_GZIP8 */
{"gzip-9", zlib_decompress}, /* ZIO_COMPRESS_GZIP9 */
{"zle", zle_decompress}, /* ZIO_COMPRESS_ZLE */
{"lz4", lz4_decompress}, /* ZIO_COMPRESS_LZ4 */
};
static grub_err_t zio_read_data (blkptr_t * bp, grub_zfs_endian_t endian,