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 @@ -42,6 +44,14 @@ config UBIFS_FS_ZLIB
16 Zlib compresses better than LZO but it is slower. Say 'Y' if unsure.
19 + bool "XZ decompression support" if UBIFS_FS_ADVANCED_COMPR
23 + XZ compresses better the ZLIB but it is slower.
26 # Debugging-related stuff
28 bool "Enable debugging support"
29 --- a/fs/ubifs/compress.c
30 +++ b/fs/ubifs/compress.c
31 @@ -71,6 +71,24 @@ static struct ubifs_compressor zlib_comp
35 +#ifdef CONFIG_UBIFS_FS_XZ
36 +static DEFINE_MUTEX(xz_enc_mutex);
37 +static DEFINE_MUTEX(xz_dec_mutex);
39 +static struct ubifs_compressor xz_compr = {
40 + .compr_type = UBIFS_COMPR_XZ,
41 + .comp_mutex = &xz_enc_mutex,
42 + .decomp_mutex = &xz_dec_mutex,
47 +static struct ubifs_compressor zlib_compr = {
48 + .compr_type = UBIFS_COMPR_XZ,
53 /* All UBIFS compressors */
54 struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT];
56 @@ -233,9 +251,15 @@ int __init ubifs_compressors_init(void)
60 + err = compr_init(&xz_compr);
64 ubifs_compressors[UBIFS_COMPR_NONE] = &none_compr;
68 + compr_exit(&zlib_compr);
70 compr_exit(&lzo_compr);
72 @@ -248,4 +272,5 @@ void ubifs_compressors_exit(void)
74 compr_exit(&lzo_compr);
75 compr_exit(&zlib_compr);
76 + compr_exit(&xz_compr);
78 --- a/fs/ubifs/ubifs-media.h
79 +++ b/fs/ubifs/ubifs-media.h
80 @@ -332,12 +332,14 @@ enum {
81 * UBIFS_COMPR_NONE: no compression
82 * UBIFS_COMPR_LZO: LZO compression
83 * UBIFS_COMPR_ZLIB: ZLIB compression
84 + * UBIFS_COMPR_XZ: XZ compression
85 * UBIFS_COMPR_TYPES_CNT: count of supported compression types
92 UBIFS_COMPR_TYPES_CNT,