diff options
author | Phillip Lougher <phillip@squashfs.org.uk> | 2014-11-27 13:48:44 -0500 |
---|---|---|
committer | Phillip Lougher <phillip@squashfs.org.uk> | 2014-11-27 13:48:44 -0500 |
commit | 62421645bb702c077ee5a462815525106cb53bcf (patch) | |
tree | 83d98b98348bcaa8c7c0ddf2cc720104fdb6e52d /fs | |
parent | 9c06a46f1524a05b2dccf5c74d7555b2cfcbe5db (diff) |
Squashfs: Add LZ4 compression configuration option
Add the glue code, and also update the documentation.
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Diffstat (limited to 'fs')
-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 | 4 |
4 files changed, 27 insertions, 0 deletions
diff --git a/fs/squashfs/Kconfig b/fs/squashfs/Kconfig index b6fa8657dcbc..ffb093e72b6c 100644 --- a/fs/squashfs/Kconfig +++ b/fs/squashfs/Kconfig | |||
@@ -120,6 +120,21 @@ config SQUASHFS_ZLIB | |||
120 | 120 | ||
121 | If unsure, say Y. | 121 | If unsure, say Y. |
122 | 122 | ||
123 | config SQUASHFS_LZ4 | ||
124 | bool "Include support for LZ4 compressed file systems" | ||
125 | depends on SQUASHFS | ||
126 | select LZ4_DECOMPRESS | ||
127 | help | ||
128 | Saying Y here includes support for reading Squashfs file systems | ||
129 | compressed with LZ4 compression. LZ4 compression is mainly | ||
130 | aimed at embedded systems with slower CPUs where the overheads | ||
131 | of zlib are too high. | ||
132 | |||
133 | LZ4 is not the standard compression used in Squashfs and so most | ||
134 | file systems will be readable without selecting this option. | ||
135 | |||
136 | If unsure, say N. | ||
137 | |||
123 | config SQUASHFS_LZO | 138 | config SQUASHFS_LZO |
124 | bool "Include support for LZO compressed file systems" | 139 | bool "Include support for LZO compressed file systems" |
125 | depends on SQUASHFS | 140 | depends on SQUASHFS |
diff --git a/fs/squashfs/Makefile b/fs/squashfs/Makefile index 4132520b4ff2..246a6f329d89 100644 --- a/fs/squashfs/Makefile +++ b/fs/squashfs/Makefile | |||
@@ -11,6 +11,7 @@ squashfs-$(CONFIG_SQUASHFS_DECOMP_SINGLE) += decompressor_single.o | |||
11 | squashfs-$(CONFIG_SQUASHFS_DECOMP_MULTI) += decompressor_multi.o | 11 | squashfs-$(CONFIG_SQUASHFS_DECOMP_MULTI) += decompressor_multi.o |
12 | squashfs-$(CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU) += decompressor_multi_percpu.o | 12 | squashfs-$(CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU) += decompressor_multi_percpu.o |
13 | squashfs-$(CONFIG_SQUASHFS_XATTR) += xattr.o xattr_id.o | 13 | squashfs-$(CONFIG_SQUASHFS_XATTR) += xattr.o xattr_id.o |
14 | squashfs-$(CONFIG_SQUASHFS_LZ4) += lz4_wrapper.o | ||
14 | squashfs-$(CONFIG_SQUASHFS_LZO) += lzo_wrapper.o | 15 | squashfs-$(CONFIG_SQUASHFS_LZO) += lzo_wrapper.o |
15 | squashfs-$(CONFIG_SQUASHFS_XZ) += xz_wrapper.o | 16 | squashfs-$(CONFIG_SQUASHFS_XZ) += xz_wrapper.o |
16 | squashfs-$(CONFIG_SQUASHFS_ZLIB) += zlib_wrapper.o | 17 | squashfs-$(CONFIG_SQUASHFS_ZLIB) += zlib_wrapper.o |
diff --git a/fs/squashfs/decompressor.c b/fs/squashfs/decompressor.c index ac22fe73b0ad..e9034bf6e5ae 100644 --- a/fs/squashfs/decompressor.c +++ b/fs/squashfs/decompressor.c | |||
@@ -41,6 +41,12 @@ static const struct squashfs_decompressor squashfs_lzma_unsupported_comp_ops = { | |||
41 | NULL, NULL, NULL, NULL, LZMA_COMPRESSION, "lzma", 0 | 41 | NULL, NULL, NULL, NULL, LZMA_COMPRESSION, "lzma", 0 |
42 | }; | 42 | }; |
43 | 43 | ||
44 | #ifndef CONFIG_SQUASHFS_LZ4 | ||
45 | static const struct squashfs_decompressor squashfs_lz4_comp_ops = { | ||
46 | NULL, NULL, NULL, NULL, LZ4_COMPRESSION, "lz4", 0 | ||
47 | }; | ||
48 | #endif | ||
49 | |||
44 | #ifndef CONFIG_SQUASHFS_LZO | 50 | #ifndef CONFIG_SQUASHFS_LZO |
45 | static const struct squashfs_decompressor squashfs_lzo_comp_ops = { | 51 | static const struct squashfs_decompressor squashfs_lzo_comp_ops = { |
46 | NULL, NULL, NULL, NULL, LZO_COMPRESSION, "lzo", 0 | 52 | NULL, NULL, NULL, NULL, LZO_COMPRESSION, "lzo", 0 |
@@ -65,6 +71,7 @@ static const struct squashfs_decompressor squashfs_unknown_comp_ops = { | |||
65 | 71 | ||
66 | static const struct squashfs_decompressor *decompressor[] = { | 72 | static const struct squashfs_decompressor *decompressor[] = { |
67 | &squashfs_zlib_comp_ops, | 73 | &squashfs_zlib_comp_ops, |
74 | &squashfs_lz4_comp_ops, | ||
68 | &squashfs_lzo_comp_ops, | 75 | &squashfs_lzo_comp_ops, |
69 | &squashfs_xz_comp_ops, | 76 | &squashfs_xz_comp_ops, |
70 | &squashfs_lzma_unsupported_comp_ops, | 77 | &squashfs_lzma_unsupported_comp_ops, |
diff --git a/fs/squashfs/decompressor.h b/fs/squashfs/decompressor.h index af0985321808..a25713c031a5 100644 --- a/fs/squashfs/decompressor.h +++ b/fs/squashfs/decompressor.h | |||
@@ -46,6 +46,10 @@ static inline void *squashfs_comp_opts(struct squashfs_sb_info *msblk, | |||
46 | extern const struct squashfs_decompressor squashfs_xz_comp_ops; | 46 | extern const struct squashfs_decompressor squashfs_xz_comp_ops; |
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | #ifdef CONFIG_SQUASHFS_LZ4 | ||
50 | extern const struct squashfs_decompressor squashfs_lz4_comp_ops; | ||
51 | #endif | ||
52 | |||
49 | #ifdef CONFIG_SQUASHFS_LZO | 53 | #ifdef CONFIG_SQUASHFS_LZO |
50 | extern const struct squashfs_decompressor squashfs_lzo_comp_ops; | 54 | extern const struct squashfs_decompressor squashfs_lzo_comp_ops; |
51 | #endif | 55 | #endif |