Lines Matching refs:stream

48 	void *stream;  member
54 struct squashfs_stream *stream) in put_decomp_stream() argument
56 mutex_lock(&stream->mutex); in put_decomp_stream()
57 list_add(&decomp_strm->list, &stream->strm_list); in put_decomp_stream()
58 mutex_unlock(&stream->mutex); in put_decomp_stream()
59 wake_up(&stream->wait); in put_decomp_stream()
65 struct squashfs_stream *stream; in squashfs_decompressor_create() local
69 stream = kzalloc(sizeof(*stream), GFP_KERNEL); in squashfs_decompressor_create()
70 if (!stream) in squashfs_decompressor_create()
73 stream->comp_opts = comp_opts; in squashfs_decompressor_create()
74 mutex_init(&stream->mutex); in squashfs_decompressor_create()
75 INIT_LIST_HEAD(&stream->strm_list); in squashfs_decompressor_create()
76 init_waitqueue_head(&stream->wait); in squashfs_decompressor_create()
88 decomp_strm->stream = msblk->decompressor->init(msblk, in squashfs_decompressor_create()
89 stream->comp_opts); in squashfs_decompressor_create()
90 if (IS_ERR(decomp_strm->stream)) { in squashfs_decompressor_create()
91 err = PTR_ERR(decomp_strm->stream); in squashfs_decompressor_create()
95 list_add(&decomp_strm->list, &stream->strm_list); in squashfs_decompressor_create()
96 stream->avail_decomp = 1; in squashfs_decompressor_create()
97 return stream; in squashfs_decompressor_create()
101 kfree(stream); in squashfs_decompressor_create()
108 struct squashfs_stream *stream = msblk->stream; in squashfs_decompressor_destroy() local
109 if (stream) { in squashfs_decompressor_destroy()
112 while (!list_empty(&stream->strm_list)) { in squashfs_decompressor_destroy()
113 decomp_strm = list_entry(stream->strm_list.prev, in squashfs_decompressor_destroy()
116 msblk->decompressor->free(decomp_strm->stream); in squashfs_decompressor_destroy()
118 stream->avail_decomp--; in squashfs_decompressor_destroy()
120 WARN_ON(stream->avail_decomp); in squashfs_decompressor_destroy()
121 kfree(stream->comp_opts); in squashfs_decompressor_destroy()
122 kfree(stream); in squashfs_decompressor_destroy()
128 struct squashfs_stream *stream) in get_decomp_stream() argument
133 mutex_lock(&stream->mutex); in get_decomp_stream()
136 if (!list_empty(&stream->strm_list)) { in get_decomp_stream()
137 decomp_strm = list_entry(stream->strm_list.prev, in get_decomp_stream()
140 mutex_unlock(&stream->mutex); in get_decomp_stream()
148 if (stream->avail_decomp >= MAX_DECOMPRESSOR) in get_decomp_stream()
156 decomp_strm->stream = msblk->decompressor->init(msblk, in get_decomp_stream()
157 stream->comp_opts); in get_decomp_stream()
158 if (IS_ERR(decomp_strm->stream)) { in get_decomp_stream()
163 stream->avail_decomp++; in get_decomp_stream()
164 WARN_ON(stream->avail_decomp > MAX_DECOMPRESSOR); in get_decomp_stream()
166 mutex_unlock(&stream->mutex); in get_decomp_stream()
174 mutex_unlock(&stream->mutex); in get_decomp_stream()
175 wait_event(stream->wait, in get_decomp_stream()
176 !list_empty(&stream->strm_list)); in get_decomp_stream()
188 struct squashfs_stream *stream = msblk->stream; in squashfs_decompress() local
189 struct decomp_stream *decomp_stream = get_decomp_stream(msblk, stream); in squashfs_decompress()
190 res = msblk->decompressor->decompress(msblk, decomp_stream->stream, in squashfs_decompress()
192 put_decomp_stream(decomp_stream, stream); in squashfs_decompress()