diff options
Diffstat (limited to 'fs/squashfs')
-rw-r--r-- | fs/squashfs/Kconfig | 14 | ||||
-rw-r--r-- | fs/squashfs/Makefile | 3 | ||||
-rw-r--r-- | fs/squashfs/decompressor.c | 6 | ||||
-rw-r--r-- | fs/squashfs/decompressor.h | 4 | ||||
-rw-r--r-- | fs/squashfs/namei.c | 10 | ||||
-rw-r--r-- | fs/squashfs/squashfs.h | 3 |
6 files changed, 26 insertions, 14 deletions
diff --git a/fs/squashfs/Kconfig b/fs/squashfs/Kconfig index 7797218d0b3..1360d4f88f4 100644 --- a/fs/squashfs/Kconfig +++ b/fs/squashfs/Kconfig | |||
@@ -1,7 +1,6 @@ | |||
1 | config SQUASHFS | 1 | config SQUASHFS |
2 | tristate "SquashFS 4.0 - Squashed file system support" | 2 | tristate "SquashFS 4.0 - Squashed file system support" |
3 | depends on BLOCK | 3 | depends on BLOCK |
4 | select ZLIB_INFLATE | ||
5 | help | 4 | help |
6 | Saying Y here includes support for SquashFS 4.0 (a Compressed | 5 | Saying Y here includes support for SquashFS 4.0 (a Compressed |
7 | Read-Only File System). Squashfs is a highly compressed read-only | 6 | Read-Only File System). Squashfs is a highly compressed read-only |
@@ -36,6 +35,19 @@ config SQUASHFS_XATTR | |||
36 | 35 | ||
37 | If unsure, say N. | 36 | If unsure, say N. |
38 | 37 | ||
38 | config SQUASHFS_ZLIB | ||
39 | bool "Include support for ZLIB compressed file systems" | ||
40 | depends on SQUASHFS | ||
41 | select ZLIB_INFLATE | ||
42 | default y | ||
43 | help | ||
44 | ZLIB compression is the standard compression used by Squashfs | ||
45 | file systems. It offers a good trade-off between compression | ||
46 | achieved and the amount of CPU time and memory necessary to | ||
47 | compress and decompress. | ||
48 | |||
49 | If unsure, say Y. | ||
50 | |||
39 | config SQUASHFS_LZO | 51 | config SQUASHFS_LZO |
40 | bool "Include support for LZO compressed file systems" | 52 | bool "Include support for LZO compressed file systems" |
41 | depends on SQUASHFS | 53 | depends on SQUASHFS |
diff --git a/fs/squashfs/Makefile b/fs/squashfs/Makefile index cecf2bea07a..110b0476f3b 100644 --- a/fs/squashfs/Makefile +++ b/fs/squashfs/Makefile | |||
@@ -4,7 +4,8 @@ | |||
4 | 4 | ||
5 | obj-$(CONFIG_SQUASHFS) += squashfs.o | 5 | obj-$(CONFIG_SQUASHFS) += squashfs.o |
6 | squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o | 6 | 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 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 | 10 | squashfs-$(CONFIG_SQUASHFS_XZ) += xz_wrapper.o |
11 | squashfs-$(CONFIG_SQUASHFS_ZLIB) += zlib_wrapper.o | ||
diff --git a/fs/squashfs/decompressor.c b/fs/squashfs/decompressor.c index 9f1b0bb96f1..3f6271d86ab 100644 --- a/fs/squashfs/decompressor.c +++ b/fs/squashfs/decompressor.c | |||
@@ -52,6 +52,12 @@ static const struct squashfs_decompressor squashfs_xz_comp_ops = { | |||
52 | }; | 52 | }; |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | #ifndef CONFIG_SQUASHFS_ZLIB | ||
56 | static const struct squashfs_decompressor squashfs_zlib_comp_ops = { | ||
57 | NULL, NULL, NULL, ZLIB_COMPRESSION, "zlib", 0 | ||
58 | }; | ||
59 | #endif | ||
60 | |||
55 | static const struct squashfs_decompressor squashfs_unknown_comp_ops = { | 61 | static const struct squashfs_decompressor squashfs_unknown_comp_ops = { |
56 | NULL, NULL, NULL, 0, "unknown", 0 | 62 | NULL, NULL, NULL, 0, "unknown", 0 |
57 | }; | 63 | }; |
diff --git a/fs/squashfs/decompressor.h b/fs/squashfs/decompressor.h index 8ba70cff09a..330073e2902 100644 --- a/fs/squashfs/decompressor.h +++ b/fs/squashfs/decompressor.h | |||
@@ -56,4 +56,8 @@ extern const struct squashfs_decompressor squashfs_xz_comp_ops; | |||
56 | extern const struct squashfs_decompressor squashfs_lzo_comp_ops; | 56 | extern const struct squashfs_decompressor squashfs_lzo_comp_ops; |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | #ifdef CONFIG_SQUASHFS_ZLIB | ||
60 | extern const struct squashfs_decompressor squashfs_zlib_comp_ops; | ||
61 | #endif | ||
62 | |||
59 | #endif | 63 | #endif |
diff --git a/fs/squashfs/namei.c b/fs/squashfs/namei.c index 4bc63ac64bc..0682b38d7e3 100644 --- a/fs/squashfs/namei.c +++ b/fs/squashfs/namei.c | |||
@@ -220,11 +220,6 @@ static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry, | |||
220 | blk, off, ino_num); | 220 | blk, off, ino_num); |
221 | 221 | ||
222 | inode = squashfs_iget(dir->i_sb, ino, ino_num); | 222 | inode = squashfs_iget(dir->i_sb, ino, ino_num); |
223 | if (IS_ERR(inode)) { | ||
224 | err = PTR_ERR(inode); | ||
225 | goto failed; | ||
226 | } | ||
227 | |||
228 | goto exit_lookup; | 223 | goto exit_lookup; |
229 | } | 224 | } |
230 | } | 225 | } |
@@ -232,10 +227,7 @@ static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry, | |||
232 | 227 | ||
233 | exit_lookup: | 228 | exit_lookup: |
234 | kfree(dire); | 229 | kfree(dire); |
235 | if (inode) | 230 | return d_splice_alias(inode, dentry); |
236 | return d_splice_alias(inode, dentry); | ||
237 | d_add(dentry, inode); | ||
238 | return ERR_PTR(0); | ||
239 | 231 | ||
240 | data_error: | 232 | data_error: |
241 | err = -EIO; | 233 | err = -EIO; |
diff --git a/fs/squashfs/squashfs.h b/fs/squashfs/squashfs.h index e3be6a71cfa..d1266516ed0 100644 --- a/fs/squashfs/squashfs.h +++ b/fs/squashfs/squashfs.h | |||
@@ -97,6 +97,3 @@ extern const struct inode_operations squashfs_symlink_inode_ops; | |||
97 | 97 | ||
98 | /* xattr.c */ | 98 | /* xattr.c */ |
99 | extern const struct xattr_handler *squashfs_xattr_handlers[]; | 99 | extern const struct xattr_handler *squashfs_xattr_handlers[]; |
100 | |||
101 | /* zlib_wrapper.c */ | ||
102 | extern const struct squashfs_decompressor squashfs_zlib_comp_ops; | ||