Lines Matching defs:zstream
249 struct z_stream_s zstream;
255 struct z_stream_s *zstream = &c->zstream;
260 zstream->workspace =
263 if (!zstream->workspace) {
277 struct z_stream_s *zstream = &c->zstream;
278 void *workspace = zstream->workspace;
280 memset(zstream, 0, sizeof(*zstream));
281 zstream->workspace = workspace;
283 return zlib_deflateInit(zstream, Z_DEFAULT_COMPRESSION) == Z_OK;
306 struct z_stream_s *zstream = &c->zstream;
308 zstream->next_in = src;
310 zstream->next_in = c->tmp;
311 zstream->avail_in = PAGE_SIZE;
314 if (zstream->avail_out == 0) {
315 zstream->next_out = compress_next_page(c, dst);
316 if (IS_ERR(zstream->next_out))
317 return PTR_ERR(zstream->next_out);
319 zstream->avail_out = PAGE_SIZE;
322 if (zlib_deflate(zstream, Z_NO_FLUSH) != Z_OK)
326 } while (zstream->avail_in);
329 if (0 && zstream->total_out > zstream->total_in)
338 struct z_stream_s *zstream = &c->zstream;
341 switch (zlib_deflate(zstream, Z_FINISH)) {
343 zstream->next_out = compress_next_page(c, dst);
344 if (IS_ERR(zstream->next_out))
345 return PTR_ERR(zstream->next_out);
347 zstream->avail_out = PAGE_SIZE;
359 memset(zstream->next_out, 0, zstream->avail_out);
360 dst->unused = zstream->avail_out;
366 zlib_deflateEnd(&c->zstream);
371 kfree(c->zstream.workspace);