27 #include <linux/slab.h>
29 #include <linux/bitops.h>
56 if (len <
sizeof(*comp_opts)) {
64 n =
ffs(dict_size) - 1;
65 if (dict_size != (1 << n) && dict_size != (1 << n) +
90 ERROR(
"Failed to initialise xz decompressor\n");
95 static void squashfs_xz_free(
void *strm)
107 struct buffer_head **bh,
int b,
int offset,
int length,
int srclength,
117 stream->
buf.in_pos = 0;
118 stream->
buf.in_size = 0;
119 stream->
buf.out_pos = 0;
121 stream->
buf.out = buffer[
page++];
124 if (stream->
buf.in_pos == stream->
buf.in_size &&
k < b) {
127 wait_on_buffer(bh[
k]);
128 if (!buffer_uptodate(bh[
k]))
133 stream->
buf.in_pos = 0;
137 if (stream->
buf.out_pos == stream->
buf.out_size
139 stream->
buf.out = buffer[
page++];
140 stream->
buf.out_pos = 0;
146 if (stream->
buf.in_pos == stream->
buf.in_size &&
k < b)
148 }
while (xz_err ==
XZ_OK);
151 ERROR(
"xz_dec_run error, data probably corrupt\n");
156 ERROR(
"xz_uncompress error, input remaining\n");
160 total += stream->
buf.out_pos;
174 .init = squashfs_xz_init,
175 .free = squashfs_xz_free,
176 .decompress = squashfs_xz_uncompress,