Lines Matching refs:stream
84 struct squashfs_xz *stream; in squashfs_xz_init() local
87 stream = kmalloc(sizeof(*stream), GFP_KERNEL); in squashfs_xz_init()
88 if (stream == NULL) { in squashfs_xz_init()
93 stream->state = xz_dec_init(XZ_PREALLOC, comp_opts->dict_size); in squashfs_xz_init()
94 if (stream->state == NULL) { in squashfs_xz_init()
95 kfree(stream); in squashfs_xz_init()
100 return stream; in squashfs_xz_init()
110 struct squashfs_xz *stream = strm; in squashfs_xz_free() local
112 if (stream) { in squashfs_xz_free()
113 xz_dec_end(stream->state); in squashfs_xz_free()
114 kfree(stream); in squashfs_xz_free()
126 struct squashfs_xz *stream = strm; in squashfs_xz_uncompress() local
128 xz_dec_reset(stream->state); in squashfs_xz_uncompress()
129 stream->buf.in_pos = 0; in squashfs_xz_uncompress()
130 stream->buf.in_size = 0; in squashfs_xz_uncompress()
131 stream->buf.out_pos = 0; in squashfs_xz_uncompress()
132 stream->buf.out_size = PAGE_SIZE; in squashfs_xz_uncompress()
133 stream->buf.out = squashfs_first_page(output); in squashfs_xz_uncompress()
134 if (IS_ERR(stream->buf.out)) { in squashfs_xz_uncompress()
135 error = PTR_ERR(stream->buf.out); in squashfs_xz_uncompress()
142 if (stream->buf.in_pos == stream->buf.in_size) { in squashfs_xz_uncompress()
155 stream->buf.in = data + offset; in squashfs_xz_uncompress()
156 stream->buf.in_size = avail; in squashfs_xz_uncompress()
157 stream->buf.in_pos = 0; in squashfs_xz_uncompress()
161 if (stream->buf.out_pos == stream->buf.out_size) { in squashfs_xz_uncompress()
162 stream->buf.out = squashfs_next_page(output); in squashfs_xz_uncompress()
163 if (IS_ERR(stream->buf.out)) { in squashfs_xz_uncompress()
164 error = PTR_ERR(stream->buf.out); in squashfs_xz_uncompress()
166 } else if (stream->buf.out != NULL) { in squashfs_xz_uncompress()
167 stream->buf.out_pos = 0; in squashfs_xz_uncompress()
172 xz_err = xz_dec_run(stream->state, &stream->buf); in squashfs_xz_uncompress()
184 return error ? error : total + stream->buf.out_pos; in squashfs_xz_uncompress()