aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-4.4/541-ubifs-xz-decompression-support.patch
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2015-12-02 22:23:22 +0000
committerJonas Gorski <jogo@openwrt.org>2015-12-02 22:23:22 +0000
commit9da189b6160422c8fe396181ff2d496fa68408b2 (patch)
tree4d911e6fe2fe7e304d340276c06729b33099013c /target/linux/generic/patches-4.4/541-ubifs-xz-decompression-support.patch
parent51a736c6287eb29cc5150f06ce8fdf10b7441a1b (diff)
downloadmaster-187ad058-9da189b6160422c8fe396181ff2d496fa68408b2.tar.gz
master-187ad058-9da189b6160422c8fe396181ff2d496fa68408b2.tar.bz2
master-187ad058-9da189b6160422c8fe396181ff2d496fa68408b2.zip
kernel: add linux 4.4 support
Based on 4.4-rc3. Runtime tested on MIPS. Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47701 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/patches-4.4/541-ubifs-xz-decompression-support.patch')
-rw-r--r--target/linux/generic/patches-4.4/541-ubifs-xz-decompression-support.patch94
1 files changed, 94 insertions, 0 deletions
diff --git a/target/linux/generic/patches-4.4/541-ubifs-xz-decompression-support.patch b/target/linux/generic/patches-4.4/541-ubifs-xz-decompression-support.patch
new file mode 100644
index 0000000000..277d91507b
--- /dev/null
+++ b/target/linux/generic/patches-4.4/541-ubifs-xz-decompression-support.patch
@@ -0,0 +1,94 @@
+--- a/fs/ubifs/Kconfig
++++ b/fs/ubifs/Kconfig
+@@ -5,8 +5,10 @@ config UBIFS_FS
+ select CRYPTO if UBIFS_FS_ADVANCED_COMPR
+ select CRYPTO if UBIFS_FS_LZO
+ select CRYPTO if UBIFS_FS_ZLIB
++ select CRYPTO if UBIFS_FS_XZ
+ select CRYPTO_LZO if UBIFS_FS_LZO
+ select CRYPTO_DEFLATE if UBIFS_FS_ZLIB
++ select CRYPTO_XZ if UBIFS_FS_XZ
+ depends on MTD_UBI
+ help
+ UBIFS is a file system for flash devices which works on top of UBI.
+@@ -36,6 +38,14 @@ config UBIFS_FS_ZLIB
+ help
+ Zlib compresses better than LZO but it is slower. Say 'Y' if unsure.
+
++config UBIFS_FS_XZ
++ bool "XZ decompression support" if UBIFS_FS_ADVANCED_COMPR
++ depends on UBIFS_FS
++ default y
++ help
++ XZ compresses better the ZLIB but it is slower..
++ Say 'Y' if unsure.
++
+ config UBIFS_ATIME_SUPPORT
+ bool "Access time support" if UBIFS_FS
+ depends on UBIFS_FS
+--- a/fs/ubifs/compress.c
++++ b/fs/ubifs/compress.c
+@@ -71,6 +71,24 @@ static struct ubifs_compressor zlib_comp
+ };
+ #endif
+
++#ifdef CONFIG_UBIFS_FS_XZ
++static DEFINE_MUTEX(xz_enc_mutex);
++static DEFINE_MUTEX(xz_dec_mutex);
++
++static struct ubifs_compressor xz_compr = {
++ .compr_type = UBIFS_COMPR_XZ,
++ .comp_mutex = &xz_enc_mutex,
++ .decomp_mutex = &xz_dec_mutex,
++ .name = "xz",
++ .capi_name = "xz",
++};
++#else
++static struct ubifs_compressor xz_compr = {
++ .compr_type = UBIFS_COMPR_XZ,
++ .name = "xz",
++};
++#endif
++
+ /* All UBIFS compressors */
+ struct ubifs_compressor *ubifs_compressors[UBIFS_COMPR_TYPES_CNT];
+
+@@ -232,9 +250,15 @@ int __init ubifs_compressors_init(void)
+ if (err)
+ goto out_lzo;
+
++ err = compr_init(&xz_compr);
++ if (err)
++ goto out_zlib;
++
+ ubifs_compressors[UBIFS_COMPR_NONE] = &none_compr;
+ return 0;
+
++out_zlib:
++ compr_exit(&zlib_compr);
+ out_lzo:
+ compr_exit(&lzo_compr);
+ return err;
+@@ -247,4 +271,5 @@ void ubifs_compressors_exit(void)
+ {
+ compr_exit(&lzo_compr);
+ compr_exit(&zlib_compr);
++ compr_exit(&xz_compr);
+ }
+--- a/fs/ubifs/ubifs-media.h
++++ b/fs/ubifs/ubifs-media.h
+@@ -332,12 +332,14 @@ enum {
+ * UBIFS_COMPR_NONE: no compression
+ * UBIFS_COMPR_LZO: LZO compression
+ * UBIFS_COMPR_ZLIB: ZLIB compression
++ * UBIFS_COMPR_XZ: XZ compression
+ * UBIFS_COMPR_TYPES_CNT: count of supported compression types
+ */
+ enum {
+ UBIFS_COMPR_NONE,
+ UBIFS_COMPR_LZO,
+ UBIFS_COMPR_ZLIB,
++ UBIFS_COMPR_XZ,
+ UBIFS_COMPR_TYPES_CNT,
+ };
+