From: Phillip Lougher <phillip@lougher.demon.co.uk>
To: Linux Kernel Development <linux-kernel@vger.kernel.org>,
linux-fsdevel@vger.kernel.org,
Linux Embedded Maillist <linux-embedded@vger.kernel.org>
Cc: Lasse Collin <lasse.collin@tukaani.org>
Subject: [PATCH 2/2] Squashfs: Add XZ compression configuration option
Date: Thu, 09 Dec 2010 06:11:33 +0000 [thread overview]
Message-ID: <4D007315.1090704@lougher.demon.co.uk> (raw)
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
---
fs/squashfs/Kconfig | 16 ++++++++++++++++
fs/squashfs/Makefile | 1 +
fs/squashfs/decompressor.c | 11 +++++++++++
fs/squashfs/squashfs.h | 3 +++
4 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/fs/squashfs/Kconfig b/fs/squashfs/Kconfig
index e5f63da..e96d99a 100644
--- a/fs/squashfs/Kconfig
+++ b/fs/squashfs/Kconfig
@@ -53,6 +53,22 @@ config SQUASHFS_LZO
If unsure, say N.
+config SQUASHFS_XZ
+ bool "Include support for XZ compressed file systems"
+ depends on SQUASHFS
+ default n
+ 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
diff --git a/fs/squashfs/Makefile b/fs/squashfs/Makefile
index 7672bac..cecf2be 100644
--- a/fs/squashfs/Makefile
+++ b/fs/squashfs/Makefile
@@ -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
diff --git a/fs/squashfs/decompressor.c b/fs/squashfs/decompressor.c
index 24af9ce..ac333b8 100644
--- a/fs/squashfs/decompressor.c
+++ b/fs/squashfs/decompressor.c
@@ -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_unsupported_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,11 @@ static const struct squashfs_decompressor *decompressor[] = {
#else
&squashfs_lzo_unsupported_comp_ops,
#endif
+#ifdef CONFIG_SQUASHFS_XZ
+ &squashfs_xz_comp_ops,
+#else
+ &squashfs_xz_unsupported_comp_ops,
+#endif
&squashfs_unknown_comp_ops
};
diff --git a/fs/squashfs/squashfs.h b/fs/squashfs/squashfs.h
index 5d45569..1096e2e 100644
--- a/fs/squashfs/squashfs.h
+++ b/fs/squashfs/squashfs.h
@@ -107,3 +107,6 @@ extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
/* lzo_wrapper.c */
extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
+
+/* xz_wrapper.c */
+extern const struct squashfs_decompressor squashfs_xz_comp_ops;
--
1.6.3.3
next reply other threads:[~2010-12-09 6:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-09 6:11 Phillip Lougher [this message]
2010-12-09 7:02 ` [PATCH 2/2] Squashfs: Add XZ compression configuration option Geert Uytterhoeven
2010-12-10 6:23 ` Phillip Lougher
2011-01-16 18:56 ` Geert Uytterhoeven
2010-12-09 9:09 ` Lasse Collin
2010-12-10 7:30 ` Phillip Lougher
2010-12-10 10:37 ` Lasse Collin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D007315.1090704@lougher.demon.co.uk \
--to=phillip@lougher.demon.co.uk \
--cc=lasse.collin@tukaani.org \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).