]> Pileus Git - ~andy/linux/commitdiff
Squashfs: Add XZ compression configuration option
authorPhillip Lougher <phillip@lougher.demon.co.uk>
Thu, 9 Dec 2010 02:08:31 +0000 (02:08 +0000)
committerPhillip Lougher <phillip@lougher.demon.co.uk>
Thu, 13 Jan 2011 21:16:52 +0000 (21:16 +0000)
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
fs/squashfs/Kconfig
fs/squashfs/Makefile
fs/squashfs/decompressor.c
fs/squashfs/decompressor.h

index e5f63da64d04b7e85b8e0afdadca34fa2b71004d..50cc4edbca064fa31b23c0972a36c35495ac102c 100644 (file)
@@ -53,6 +53,21 @@ config SQUASHFS_LZO
 
          If unsure, say N.
 
+config SQUASHFS_XZ
+       bool "Include support for XZ compressed file systems"
+       depends on SQUASHFS
+       select XZ_DEC
+       help
+         Saying Y here includes support for reading Squashfs file systems
+         compressed with XZ compresssion.  XZ gives better compression than
+         the default zlib compression, at the expense of greater CPU and
+         memory overhead.
+
+         XZ is not the standard compression used in Squashfs and so most
+         file systems will be readable without selecting this option.
+
+         If unsure, say N.
+
 config SQUASHFS_EMBEDDED
        bool "Additional option for memory-constrained systems"
        depends on SQUASHFS
index 7672bac8d3285c10f20cd7a2cb5785564507d60a..cecf2bea07afdcd7c5e0771930ab0cdb50f0c37e 100644 (file)
@@ -7,3 +7,4 @@ squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o
 squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o
 squashfs-$(CONFIG_SQUASHFS_XATTR) += xattr.o xattr_id.o
 squashfs-$(CONFIG_SQUASHFS_LZO) += lzo_wrapper.o
+squashfs-$(CONFIG_SQUASHFS_XZ) += xz_wrapper.o
index 24af9ce9722f5156d0989b1591609c9600df972b..482d78197811bcc023543541a9a413e25bf32a22 100644 (file)
@@ -46,6 +46,12 @@ static const struct squashfs_decompressor squashfs_lzo_unsupported_comp_ops = {
 };
 #endif
 
+#ifndef CONFIG_SQUASHFS_XZ
+static const struct squashfs_decompressor squashfs_xz_comp_ops = {
+       NULL, NULL, NULL, XZ_COMPRESSION, "xz", 0
+};
+#endif
+
 static const struct squashfs_decompressor squashfs_unknown_comp_ops = {
        NULL, NULL, NULL, 0, "unknown", 0
 };
@@ -58,6 +64,7 @@ static const struct squashfs_decompressor *decompressor[] = {
 #else
        &squashfs_lzo_unsupported_comp_ops,
 #endif
+       &squashfs_xz_comp_ops,
        &squashfs_unknown_comp_ops
 };
 
index 7425f80783f60bbaae7b8f2539da1c07b2e5ef8f..57e1acb4c6a964af0a1e09e03a8915741f755064 100644 (file)
@@ -52,4 +52,9 @@ static inline int squashfs_decompress(struct squashfs_sb_info *msblk,
        return msblk->decompressor->decompress(msblk, buffer, bh, b, offset,
                length, srclength, pages);
 }
+
+#ifdef CONFIG_SQUASHFS_XZ
+extern const struct squashfs_decompressor squashfs_xz_comp_ops;
+#endif
+
 #endif