Lines Matching refs:stream
50 void *stream; member
56 struct squashfs_stream *stream) in put_decomp_stream() argument
58 mutex_lock(&stream->mutex); in put_decomp_stream()
59 list_add(&decomp_strm->list, &stream->strm_list); in put_decomp_stream()
60 mutex_unlock(&stream->mutex); in put_decomp_stream()
61 wake_up(&stream->wait); in put_decomp_stream()
67 struct squashfs_stream *stream; in squashfs_decompressor_create() local
71 stream = kzalloc(sizeof(*stream), GFP_KERNEL); in squashfs_decompressor_create()
72 if (!stream) in squashfs_decompressor_create()
75 stream->comp_opts = comp_opts; in squashfs_decompressor_create()
76 mutex_init(&stream->mutex); in squashfs_decompressor_create()
77 INIT_LIST_HEAD(&stream->strm_list); in squashfs_decompressor_create()
78 init_waitqueue_head(&stream->wait); in squashfs_decompressor_create()
90 decomp_strm->stream = msblk->decompressor->init(msblk, in squashfs_decompressor_create()
91 stream->comp_opts); in squashfs_decompressor_create()
92 if (IS_ERR(decomp_strm->stream)) { in squashfs_decompressor_create()
93 err = PTR_ERR(decomp_strm->stream); in squashfs_decompressor_create()
97 list_add(&decomp_strm->list, &stream->strm_list); in squashfs_decompressor_create()
98 stream->avail_decomp = 1; in squashfs_decompressor_create()
99 return stream; in squashfs_decompressor_create()
103 kfree(stream); in squashfs_decompressor_create()
110 struct squashfs_stream *stream = msblk->stream; in squashfs_decompressor_destroy() local
111 if (stream) { in squashfs_decompressor_destroy()
114 while (!list_empty(&stream->strm_list)) { in squashfs_decompressor_destroy()
115 decomp_strm = list_entry(stream->strm_list.prev, in squashfs_decompressor_destroy()
118 msblk->decompressor->free(decomp_strm->stream); in squashfs_decompressor_destroy()
120 stream->avail_decomp--; in squashfs_decompressor_destroy()
122 WARN_ON(stream->avail_decomp); in squashfs_decompressor_destroy()
123 kfree(stream->comp_opts); in squashfs_decompressor_destroy()
124 kfree(stream); in squashfs_decompressor_destroy()
130 struct squashfs_stream *stream) in get_decomp_stream() argument
135 mutex_lock(&stream->mutex); in get_decomp_stream()
138 if (!list_empty(&stream->strm_list)) { in get_decomp_stream()
139 decomp_strm = list_entry(stream->strm_list.prev, in get_decomp_stream()
142 mutex_unlock(&stream->mutex); in get_decomp_stream()
150 if (stream->avail_decomp >= MAX_DECOMPRESSOR) in get_decomp_stream()
158 decomp_strm->stream = msblk->decompressor->init(msblk, in get_decomp_stream()
159 stream->comp_opts); in get_decomp_stream()
160 if (IS_ERR(decomp_strm->stream)) { in get_decomp_stream()
165 stream->avail_decomp++; in get_decomp_stream()
166 WARN_ON(stream->avail_decomp > MAX_DECOMPRESSOR); in get_decomp_stream()
168 mutex_unlock(&stream->mutex); in get_decomp_stream()
176 mutex_unlock(&stream->mutex); in get_decomp_stream()
177 wait_event(stream->wait, in get_decomp_stream()
178 !list_empty(&stream->strm_list)); in get_decomp_stream()
189 struct squashfs_stream *stream = msblk->stream; in squashfs_decompress() local
190 struct decomp_stream *decomp_stream = get_decomp_stream(msblk, stream); in squashfs_decompress()
191 res = msblk->decompressor->decompress(msblk, decomp_stream->stream, in squashfs_decompress()
193 put_decomp_stream(decomp_stream, stream); in squashfs_decompress()