Lines Matching refs:strm
23 struct z_erofs_deflate *strm; in z_erofs_deflate_exit() local
26 strm = z_erofs_deflate_head; in z_erofs_deflate_exit()
27 if (!strm) { in z_erofs_deflate_exit()
34 while (strm) { in z_erofs_deflate_exit()
35 struct z_erofs_deflate *n = strm->next; in z_erofs_deflate_exit()
37 vfree(strm->z.workspace); in z_erofs_deflate_exit()
38 kfree(strm); in z_erofs_deflate_exit()
40 strm = n; in z_erofs_deflate_exit()
53 struct z_erofs_deflate *strm; in z_erofs_deflate_init() local
55 strm = kzalloc(sizeof(*strm), GFP_KERNEL); in z_erofs_deflate_init()
56 if (!strm) in z_erofs_deflate_init()
60 strm->z.workspace = vmalloc(zlib_inflate_workspacesize()); in z_erofs_deflate_init()
61 if (!strm->z.workspace) { in z_erofs_deflate_init()
62 kfree(strm); in z_erofs_deflate_init()
67 strm->next = z_erofs_deflate_head; in z_erofs_deflate_init()
68 z_erofs_deflate_head = strm; in z_erofs_deflate_init()
106 struct z_erofs_deflate *strm; in z_erofs_deflate_decompress() local
124 strm = z_erofs_deflate_head; in z_erofs_deflate_decompress()
125 if (!strm) { in z_erofs_deflate_decompress()
130 z_erofs_deflate_head = strm->next; in z_erofs_deflate_decompress()
136 zerr = zlib_inflateInit2(&strm->z, -MAX_WBITS); in z_erofs_deflate_decompress()
143 strm->z.avail_in = min_t(u32, insz, PAGE_SIZE - rq->pageofs_in); in z_erofs_deflate_decompress()
144 insz -= strm->z.avail_in; in z_erofs_deflate_decompress()
145 strm->z.next_in = kin + rq->pageofs_in; in z_erofs_deflate_decompress()
146 strm->z.avail_out = 0; in z_erofs_deflate_decompress()
149 if (!strm->z.avail_out) { in z_erofs_deflate_decompress()
158 strm->z.avail_out = min_t(u32, outsz, PAGE_SIZE - pofs); in z_erofs_deflate_decompress()
159 outsz -= strm->z.avail_out; in z_erofs_deflate_decompress()
167 strm->z.next_out = kout + pofs; in z_erofs_deflate_decompress()
171 if (!strm->z.avail_in && insz) { in z_erofs_deflate_decompress()
179 j = strm->z.next_out - kout; in z_erofs_deflate_decompress()
183 strm->z.avail_in = min_t(u32, insz, PAGE_SIZE); in z_erofs_deflate_decompress()
184 insz -= strm->z.avail_in; in z_erofs_deflate_decompress()
186 strm->z.next_in = kin; in z_erofs_deflate_decompress()
190 strm->z.next_out = kout + j; in z_erofs_deflate_decompress()
201 memcpy(strm->bounce, strm->z.next_in, strm->z.avail_in); in z_erofs_deflate_decompress()
202 strm->z.next_in = strm->bounce; in z_erofs_deflate_decompress()
221 zerr = zlib_inflate(&strm->z, Z_SYNC_FLUSH); in z_erofs_deflate_decompress()
222 if (zerr != Z_OK || !(outsz + strm->z.avail_out)) { in z_erofs_deflate_decompress()
234 if (zlib_inflateEnd(&strm->z) != Z_OK && !err) in z_erofs_deflate_decompress()
242 strm->next = z_erofs_deflate_head; in z_erofs_deflate_decompress()
243 z_erofs_deflate_head = strm; in z_erofs_deflate_decompress()