From 703081da2a99426999c67eaf378063dd74d0a4f6 Mon Sep 17 00:00:00 2001 From: Phillip Lougher Date: Thu, 9 Dec 2010 02:08:31 +0000 Subject: [PATCH] --- yaml --- r: 231533 b: refs/heads/master c: 7a43ae523744c01b6187013e781f44c2281c579c h: refs/heads/master i: 231531: 454cd236db73c4e82e3889c6e43298c7e7110764 v: v3 --- [refs] | 2 +- trunk/fs/squashfs/Kconfig | 15 +++++++++++++++ trunk/fs/squashfs/Makefile | 1 + trunk/fs/squashfs/decompressor.c | 7 +++++++ trunk/fs/squashfs/decompressor.h | 5 +++++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 7fe390ddec72..253e572c5d77 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 81bb8debd0d570dc67dc1e9d8b612632cb941893 +refs/heads/master: 7a43ae523744c01b6187013e781f44c2281c579c diff --git a/trunk/fs/squashfs/Kconfig b/trunk/fs/squashfs/Kconfig index e5f63da64d04..50cc4edbca06 100644 --- a/trunk/fs/squashfs/Kconfig +++ b/trunk/fs/squashfs/Kconfig @@ -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 diff --git a/trunk/fs/squashfs/Makefile b/trunk/fs/squashfs/Makefile index 7672bac8d328..cecf2bea07af 100644 --- a/trunk/fs/squashfs/Makefile +++ b/trunk/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/trunk/fs/squashfs/decompressor.c b/trunk/fs/squashfs/decompressor.c index 24af9ce9722f..482d78197811 100644 --- a/trunk/fs/squashfs/decompressor.c +++ b/trunk/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_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 }; diff --git a/trunk/fs/squashfs/decompressor.h b/trunk/fs/squashfs/decompressor.h index 7425f80783f6..57e1acb4c6a9 100644 --- a/trunk/fs/squashfs/decompressor.h +++ b/trunk/fs/squashfs/decompressor.h @@ -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