Skip to contentSkip to conversation

Squashfs: Add LZO compression support

PATCH New Phillip Lougher 1 participant 1 message Aug 6, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/7 Squashfs: Add LZO compression support

---
 fs/squashfs/Kconfig        |    5 ++
 fs/squashfs/Makefile       |    2 +-
 fs/squashfs/decompressor.c |    6 ++
 fs/squashfs/lzo_wrapper.c  |  134 ++++++++++++++++++++++++++++++++++++++++++++
 fs/squashfs/squashfs.h     |    3 +
 5 files changed, 149 insertions(+), 1 deletions(-)
 create mode 100644 fs/squashfs/lzo_wrapper.c
fs/squashfs/Kconfig +5 -0
index 3e9ee95..3da0110 100644
@@ -37,6 +37,11 @@ config SQUASHFS_XATTR
 
 	  If unsure, say N.
 
+config SQUASHFS_LZO
+	bool "Include support for LZO compressed file systems"
+	depends on SQUASHFS
+	select LZO_DECOMPRESS
+
 config SQUASHFS_EMBEDDED
 
 	bool "Additional option for memory-constrained systems"
fs/squashfs/Makefile +1 -1
index 6fa6b9d..7672bac 100644
@@ -6,4 +6,4 @@ obj-$(CONFIG_SQUASHFS) += squashfs.o
 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
fs/squashfs/decompressor.c +6 -0
index 157478d..24af9ce 100644
@@ -40,9 +40,11 @@ static const struct squashfs_decompressor squashfs_lzma_unsupported_comp_ops = {
 	NULL, NULL, NULL, LZMA_COMPRESSION, "lzma", 0
 };
 
+#ifndef CONFIG_SQUASHFS_LZO
 static const struct squashfs_decompressor squashfs_lzo_unsupported_comp_ops = {
 	NULL, NULL, NULL, LZO_COMPRESSION, "lzo", 0
 };
+#endif
 
 static const struct squashfs_decompressor squashfs_unknown_comp_ops = {
 	NULL, NULL, NULL, 0, "unknown", 0
@@ -51,7 +53,11 @@ static const struct squashfs_decompressor squashfs_unknown_comp_ops = {
 static const struct squashfs_decompressor *decompressor[] = {
 	&squashfs_zlib_comp_ops,
 	&squashfs_lzma_unsupported_comp_ops,
+#ifdef CONFIG_SQUASHFS_LZO
+	&squashfs_lzo_comp_ops,
+#else
 	&squashfs_lzo_unsupported_comp_ops,
+#endif
 	&squashfs_unknown_comp_ops
 };
 
fs/squashfs/lzo_wrapper.c new file +134 -0

134 lines not on this page · raw message

fs/squashfs/squashfs.h +3 -0
index 733a17c..3a95ea6 100644
@@ -104,3 +104,6 @@ extern const struct xattr_handler *squashfs_xattr_handlers[];
 
 /* zlib_wrapper.c */
 extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
+
+/* lzo_wrappers.c */
+extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
Signature · 1 line
1.6.3.3