diff options
author | Phillip Lougher <phillip@lougher.demon.co.uk> | 2010-12-08 21:08:31 -0500 |
---|---|---|
committer | Phillip Lougher <phillip@lougher.demon.co.uk> | 2011-01-13 16:16:52 -0500 |
commit | 7a43ae523744c01b6187013e781f44c2281c579c (patch) | |
tree | 7f122fb883ef7cd86f08f90b770e03cae601efd3 /fs/squashfs | |
parent | 81bb8debd0d570dc67dc1e9d8b612632cb941893 (diff) |
Squashfs: Add XZ compression configuration option
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Diffstat (limited to 'fs/squashfs')
-rw-r--r-- | fs/squashfs/Kconfig | 15 | ||||
-rw-r--r-- | fs/squashfs/Makefile | 1 | ||||
-rw-r--r-- | fs/squashfs/decompressor.c | 7 | ||||
-rw-r--r-- | fs/squashfs/decompressor.h | 5 |
4 files changed, 28 insertions, 0 deletions
diff --git a/fs/squashfs/Kconfig b/fs/squashfs/Kconfig index e5f63da64d04..50cc4edbca06 100644 --- a/fs/squashfs/Kconfig +++ b/fs/squashfs/Kconfig | |||
@@ -53,6 +53,21 @@ config SQUASHFS_LZO | |||
53 | 53 | ||
54 | If unsure, say N. | 54 | If unsure, say N. |
55 | 55 | ||
56 | config SQUASHFS_XZ | ||
57 | bool "Include support for XZ compressed file systems" | ||
58 | depends on SQUASHFS | ||
59 | select XZ_DEC | ||
60 | help | ||
61 | Saying Y here includes support for reading Squashfs file systems | ||
62 | compressed with XZ compresssion. XZ gives better compression than | ||
63 | the default zlib compression, at the expense of greater CPU and | ||
64 | memory overhead. | ||
65 | |||
66 | XZ is not the standard compression used in Squashfs and so most | ||
67 | file systems will be readable without selecting this option. | ||
68 | |||
69 | If unsure, say N. | ||
70 | |||
56 | config SQUASHFS_EMBEDDED | 71 | config SQUASHFS_EMBEDDED |
57 | bool "Additional option for memory-constrained systems" | 72 | bool "Additional option for memory-constrained systems" |
58 | depends on SQUASHFS | 73 | depends on SQUASHFS |
diff --git a/fs/squashfs/Makefile b/fs/squashfs/Makefile index 7672bac8d328..cecf2bea07af 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 | |||
7 | squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o | 7 | squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o |
8 | squashfs-$(CONFIG_SQUASHFS_XATTR) += xattr.o xattr_id.o | 8 | squashfs-$(CONFIG_SQUASHFS_XATTR) += xattr.o xattr_id.o |
9 | squashfs-$(CONFIG_SQUASHFS_LZO) += lzo_wrapper.o | 9 | squashfs-$(CONFIG_SQUASHFS_LZO) += lzo_wrapper.o |
10 | squashfs-$(CONFIG_SQUASHFS_XZ) += xz_wrapper.o | ||
diff --git a/fs/squashfs/decompressor.c b/fs/squashfs/decompressor.c index 24af9ce9722f..482d78197811 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 = { | |||
46 | }; | 46 | }; |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #ifndef CONFIG_SQUASHFS_XZ | ||
50 | static const struct squashfs_decompressor squashfs_xz_comp_ops = { | ||
51 | NULL, NULL, NULL, XZ_COMPRESSION, "xz", 0 | ||
52 | }; | ||
53 | #endif | ||
54 | |||
49 | static const struct squashfs_decompressor squashfs_unknown_comp_ops = { | 55 | static const struct squashfs_decompressor squashfs_unknown_comp_ops = { |
50 | NULL, NULL, NULL, 0, "unknown", 0 | 56 | NULL, NULL, NULL, 0, "unknown", 0 |
51 | }; | 57 | }; |
@@ -58,6 +64,7 @@ static const struct squashfs_decompressor *decompressor[] = { | |||
58 | #else | 64 | #else |
59 | &squashfs_lzo_unsupported_comp_ops, | 65 | &squashfs_lzo_unsupported_comp_ops, |
60 | #endif | 66 | #endif |
67 | &squashfs_xz_comp_ops, | ||
61 | &squashfs_unknown_comp_ops | 68 | &squashfs_unknown_comp_ops |
62 | }; | 69 | }; |
63 | 70 | ||
diff --git a/fs/squashfs/decompressor.h b/fs/squashfs/decompressor.h index 7425f80783f6..57e1acb4c6a9 100644 --- a/fs/squashfs/decompressor.h +++ b/fs/squashfs/decompressor.h | |||
@@ -52,4 +52,9 @@ static inline int squashfs_decompress(struct squashfs_sb_info *msblk, | |||
52 | return msblk->decompressor->decompress(msblk, buffer, bh, b, offset, | 52 | return msblk->decompressor->decompress(msblk, buffer, bh, b, offset, |
53 | length, srclength, pages); | 53 | length, srclength, pages); |
54 | } | 54 | } |
55 | |||
56 | #ifdef CONFIG_SQUASHFS_XZ | ||
57 | extern const struct squashfs_decompressor squashfs_xz_comp_ops; | ||
58 | #endif | ||
59 | |||
55 | #endif | 60 | #endif |