Lines Matching refs:stream

47 	void *stream;  member
53 struct squashfs_stream *stream) in put_decomp_stream() argument
55 mutex_lock(&stream->mutex); in put_decomp_stream()
56 list_add(&decomp_strm->list, &stream->strm_list); in put_decomp_stream()
57 mutex_unlock(&stream->mutex); in put_decomp_stream()
58 wake_up(&stream->wait); in put_decomp_stream()
64 struct squashfs_stream *stream; in squashfs_decompressor_create() local
68 stream = kzalloc(sizeof(*stream), GFP_KERNEL); in squashfs_decompressor_create()
69 if (!stream) in squashfs_decompressor_create()
72 stream->comp_opts = comp_opts; in squashfs_decompressor_create()
73 mutex_init(&stream->mutex); in squashfs_decompressor_create()
74 INIT_LIST_HEAD(&stream->strm_list); in squashfs_decompressor_create()
75 init_waitqueue_head(&stream->wait); in squashfs_decompressor_create()
87 decomp_strm->stream = msblk->decompressor->init(msblk, in squashfs_decompressor_create()
88 stream->comp_opts); in squashfs_decompressor_create()
89 if (IS_ERR(decomp_strm->stream)) { in squashfs_decompressor_create()
90 err = PTR_ERR(decomp_strm->stream); in squashfs_decompressor_create()
94 list_add(&decomp_strm->list, &stream->strm_list); in squashfs_decompressor_create()
95 stream->avail_decomp = 1; in squashfs_decompressor_create()
96 return stream; in squashfs_decompressor_create()
100 kfree(stream); in squashfs_decompressor_create()
107 struct squashfs_stream *stream = msblk->stream; in squashfs_decompressor_destroy() local
108 if (stream) { in squashfs_decompressor_destroy()
111 while (!list_empty(&stream->strm_list)) { in squashfs_decompressor_destroy()
112 decomp_strm = list_entry(stream->strm_list.prev, in squashfs_decompressor_destroy()
115 msblk->decompressor->free(decomp_strm->stream); in squashfs_decompressor_destroy()
117 stream->avail_decomp--; in squashfs_decompressor_destroy()
119 WARN_ON(stream->avail_decomp); in squashfs_decompressor_destroy()
120 kfree(stream->comp_opts); in squashfs_decompressor_destroy()
121 kfree(stream); in squashfs_decompressor_destroy()
127 struct squashfs_stream *stream) in get_decomp_stream() argument
132 mutex_lock(&stream->mutex); in get_decomp_stream()
135 if (!list_empty(&stream->strm_list)) { in get_decomp_stream()
136 decomp_strm = list_entry(stream->strm_list.prev, in get_decomp_stream()
139 mutex_unlock(&stream->mutex); in get_decomp_stream()
147 if (stream->avail_decomp >= msblk->max_thread_num) in get_decomp_stream()
155 decomp_strm->stream = msblk->decompressor->init(msblk, in get_decomp_stream()
156 stream->comp_opts); in get_decomp_stream()
157 if (IS_ERR(decomp_strm->stream)) { in get_decomp_stream()
162 stream->avail_decomp++; in get_decomp_stream()
163 WARN_ON(stream->avail_decomp > msblk->max_thread_num); in get_decomp_stream()
165 mutex_unlock(&stream->mutex); in get_decomp_stream()
173 mutex_unlock(&stream->mutex); in get_decomp_stream()
174 wait_event(stream->wait, in get_decomp_stream()
175 !list_empty(&stream->strm_list)); in get_decomp_stream()
187 struct squashfs_stream *stream = msblk->stream; in squashfs_decompress() local
188 struct decomp_stream *decomp_stream = get_decomp_stream(msblk, stream); in squashfs_decompress()
189 res = msblk->decompressor->decompress(msblk, decomp_stream->stream, in squashfs_decompress()
191 put_decomp_stream(decomp_stream, stream); in squashfs_decompress()