1 --- a/fs/squashfs/decompressor.c
2 +++ b/fs/squashfs/decompressor.c
3 @@ -40,11 +40,9 @@ static const struct squashfs_decompresso
4 NULL, NULL, NULL, LZMA_COMPRESSION, "lzma", 0
7 -#ifndef CONFIG_SQUASHFS_LZO
8 static const struct squashfs_decompressor squashfs_lzo_unsupported_comp_ops = {
9 NULL, NULL, NULL, LZO_COMPRESSION, "lzo", 0
13 static const struct squashfs_decompressor squashfs_unknown_comp_ops = {
14 NULL, NULL, NULL, 0, "unknown", 0
15 @@ -53,11 +51,7 @@ static const struct squashfs_decompresso
16 static const struct squashfs_decompressor *decompressor[] = {
17 &squashfs_zlib_comp_ops,
18 &squashfs_lzma_unsupported_comp_ops,
19 -#ifdef CONFIG_SQUASHFS_LZO
20 - &squashfs_lzo_comp_ops,
22 &squashfs_lzo_unsupported_comp_ops,
24 &squashfs_unknown_comp_ops
27 --- a/fs/squashfs/Kconfig
28 +++ b/fs/squashfs/Kconfig
29 @@ -5,13 +5,13 @@ config SQUASHFS
31 Saying Y here includes support for SquashFS 4.0 (a Compressed
32 Read-Only File System). Squashfs is a highly compressed read-only
33 - filesystem for Linux. It uses zlib/lzo compression to compress both
34 + filesystem for Linux. It uses zlib compression to compress both
35 files, inodes and directories. Inodes in the system are very small
36 and all blocks are packed to minimise data overhead. Block sizes
37 greater than 4K are supported up to a maximum of 1 Mbytes (default
38 block size 128K). SquashFS 4.0 supports 64 bit filesystems and files
39 (larger than 4GB), full uid/gid information, hard links and
43 Squashfs is intended for general read-only filesystem use, for
44 archival use (i.e. in cases where a .tar.gz file may be used), and in
45 @@ -26,7 +26,7 @@ config SQUASHFS
49 -config SQUASHFS_XATTR
50 +config SQUASHFS_XATTRS
51 bool "Squashfs XATTR support"
54 @@ -37,24 +37,9 @@ config SQUASHFS_XATTR
59 - bool "Include support for LZO compressed file systems"
62 - select LZO_DECOMPRESS
64 - Saying Y here includes support for reading Squashfs file systems
65 - compressed with LZO compresssion. LZO compression is mainly
66 - aimed at embedded systems with slower CPUs where the overheads
67 - of zlib are too high.
69 - LZO is not the standard compression used in Squashfs and so most
70 - file systems will be readable without selecting this option.
74 config SQUASHFS_EMBEDDED
75 - bool "Additional option for memory-constrained systems"
77 + bool "Additional option for memory-constrained systems"
81 --- a/fs/squashfs/lzo_wrapper.c
85 - * Squashfs - a compressed read only filesystem for Linux
87 - * Copyright (c) 2010 LG Electronics
88 - * Chan Jeong <chan.jeong@lge.com>
90 - * This program is free software; you can redistribute it and/or
91 - * modify it under the terms of the GNU General Public License
92 - * as published by the Free Software Foundation; either version 2,
93 - * or (at your option) any later version.
95 - * This program is distributed in the hope that it will be useful,
96 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
97 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
98 - * GNU General Public License for more details.
100 - * You should have received a copy of the GNU General Public License
101 - * along with this program; if not, write to the Free Software
102 - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
107 -#include <linux/mutex.h>
108 -#include <linux/buffer_head.h>
109 -#include <linux/slab.h>
110 -#include <linux/vmalloc.h>
111 -#include <linux/lzo.h>
113 -#include "squashfs_fs.h"
114 -#include "squashfs_fs_sb.h"
115 -#include "squashfs_fs_i.h"
116 -#include "squashfs.h"
117 -#include "decompressor.h"
119 -struct squashfs_lzo {
124 -static void *lzo_init(struct squashfs_sb_info *msblk)
126 - int block_size = max_t(int, msblk->block_size, SQUASHFS_METADATA_SIZE);
128 - struct squashfs_lzo *stream = kzalloc(sizeof(*stream), GFP_KERNEL);
129 - if (stream == NULL)
131 - stream->input = vmalloc(block_size);
132 - if (stream->input == NULL)
134 - stream->output = vmalloc(block_size);
135 - if (stream->output == NULL)
141 - vfree(stream->input);
143 - ERROR("Failed to allocate lzo workspace\n");
149 -static void lzo_free(void *strm)
151 - struct squashfs_lzo *stream = strm;
154 - vfree(stream->input);
155 - vfree(stream->output);
161 -static int lzo_uncompress(struct squashfs_sb_info *msblk, void **buffer,
162 - struct buffer_head **bh, int b, int offset, int length, int srclength,
165 - struct squashfs_lzo *stream = msblk->stream;
166 - void *buff = stream->input;
167 - int avail, i, bytes = length, res;
168 - size_t out_len = srclength;
170 - mutex_lock(&msblk->read_data_mutex);
172 - for (i = 0; i < b; i++) {
173 - wait_on_buffer(bh[i]);
174 - if (!buffer_uptodate(bh[i]))
175 - goto block_release;
177 - avail = min(bytes, msblk->devblksize - offset);
178 - memcpy(buff, bh[i]->b_data + offset, avail);
185 - res = lzo1x_decompress_safe(stream->input, (size_t)length,
186 - stream->output, &out_len);
187 - if (res != LZO_E_OK)
190 - res = bytes = (int)out_len;
191 - for (i = 0, buff = stream->output; bytes && i < pages; i++) {
192 - avail = min_t(int, bytes, PAGE_CACHE_SIZE);
193 - memcpy(buffer[i], buff, avail);
198 - mutex_unlock(&msblk->read_data_mutex);
206 - mutex_unlock(&msblk->read_data_mutex);
208 - ERROR("lzo decompression failed, data probably corrupt\n");
212 -const struct squashfs_decompressor squashfs_lzo_comp_ops = {
215 - .decompress = lzo_uncompress,
216 - .id = LZO_COMPRESSION,
220 --- a/fs/squashfs/Makefile
221 +++ b/fs/squashfs/Makefile
223 obj-$(CONFIG_SQUASHFS) += squashfs.o
224 squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o
225 squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o
226 -squashfs-$(CONFIG_SQUASHFS_XATTR) += xattr.o xattr_id.o
227 -squashfs-$(CONFIG_SQUASHFS_LZO) += lzo_wrapper.o
228 +squashfs-$(CONFIG_SQUASHFS_XATTRS) += xattr.o xattr_id.o
230 --- a/fs/squashfs/squashfs.h
231 +++ b/fs/squashfs/squashfs.h
232 @@ -104,6 +104,3 @@ extern const struct xattr_handler *squas
235 extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
238 -extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
239 --- a/fs/squashfs/xattr.h
240 +++ b/fs/squashfs/xattr.h
245 -#ifdef CONFIG_SQUASHFS_XATTR
246 +#ifdef CONFIG_SQUASHFS_XATTRS
247 extern __le64 *squashfs_read_xattr_id_table(struct super_block *, u64,
249 extern int squashfs_xattr_lookup(struct super_block *, unsigned int, int *,