3 @@ -5,8 +5,10 @@ config UBIFS_FS
4 select CRYPTO if UBIFS_FS_ADVANCED_COMPR
5 select CRYPTO if UBIFS_FS_LZO
6 select CRYPTO if UBIFS_FS_ZLIB
7 + select CRYPTO if UBIFS_FS_XZ
8 select CRYPTO_LZO if UBIFS_FS_LZO
9 select CRYPTO_DEFLATE if UBIFS_FS_ZLIB
10 + select CRYPTO_XZ if UBIFS_FS_XZ
13 UBIFS is a file system for flash devices which works on top of UBI.
14 @@ -35,3 +37,12 @@ config UBIFS_FS_ZLIB
17 Zlib compresses better than LZO but it is slower. Say 'Y' if unsure.
20 + bool "XZ decompression support" if UBIFS_FS_ADVANCED_COMPR
24 + XZ compresses better the ZLIB but it is slower..
27 --- a/fs/ubifs/compress.c
28 +++ b/fs/ubifs/compress.c
29 @@ -71,6 +71,24 @@ static struct ubifs_compressor zlib_comp
33 +#ifdef CONFIG_UBIFS_FS_XZ
34 +static DEFINE_MUTEX(xz_enc_mutex);
35 +static DEFINE_MUTEX(xz_dec_mutex);
37 +static struct ubifs_compressor xz_compr = {
38 + .compr_type = UBIFS_COMPR_XZ,
39 + .comp_mutex = &xz_enc_mutex,
40 + .decomp_mutex = &xz_dec_mutex,
45 +static struct ubifs_compressor xz_compr = {
46 + .compr_type = UBIFS_COMPR_XZ,
51 /* All UBIFS compressors */
52 struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT];
54 @@ -232,9 +250,15 @@ int __init ubifs_compressors_init(void)
58 + err = compr_init(&xz_compr);
62 ubifs_compressors[UBIFS_COMPR_NONE] = &none_compr;
66 + compr_exit(&zlib_compr);
68 compr_exit(&lzo_compr);
70 @@ -247,4 +271,5 @@ void ubifs_compressors_exit(void)
72 compr_exit(&lzo_compr);
73 compr_exit(&zlib_compr);
74 + compr_exit(&xz_compr);
76 --- a/fs/ubifs/ubifs-media.h
77 +++ b/fs/ubifs/ubifs-media.h
78 @@ -332,12 +332,14 @@ enum {
79 * UBIFS_COMPR_NONE: no compression
80 * UBIFS_COMPR_LZO: LZO compression
81 * UBIFS_COMPR_ZLIB: ZLIB compression
82 + * UBIFS_COMPR_XZ: XZ compression
83 * UBIFS_COMPR_TYPES_CNT: count of supported compression types
90 UBIFS_COMPR_TYPES_CNT,