Lines Matching defs:zstream
273 struct z_stream_s zstream;
279 struct z_stream_s *zstream = &c->zstream;
284 zstream->workspace =
287 if (!zstream->workspace) {
301 struct z_stream_s *zstream = &c->zstream;
302 void *workspace = zstream->workspace;
304 memset(zstream, 0, sizeof(*zstream));
305 zstream->workspace = workspace;
307 return zlib_deflateInit(zstream, Z_DEFAULT_COMPRESSION) == Z_OK;
330 struct z_stream_s *zstream = &c->zstream;
332 zstream->next_in = src;
334 zstream->next_in = c->tmp;
335 zstream->avail_in = PAGE_SIZE;
338 if (zstream->avail_out == 0) {
339 zstream->next_out = compress_next_page(c, dst);
340 if (IS_ERR(zstream->next_out))
341 return PTR_ERR(zstream->next_out);
343 zstream->avail_out = PAGE_SIZE;
346 if (zlib_deflate(zstream, Z_NO_FLUSH) != Z_OK)
350 } while (zstream->avail_in);
353 if (0 && zstream->total_out > zstream->total_in)
362 struct z_stream_s *zstream = &c->zstream;
365 switch (zlib_deflate(zstream, Z_FINISH)) {
367 zstream->next_out = compress_next_page(c, dst);
368 if (IS_ERR(zstream->next_out))
369 return PTR_ERR(zstream->next_out);
371 zstream->avail_out = PAGE_SIZE;
383 memset(zstream->next_out, 0, zstream->avail_out);
384 dst->unused = zstream->avail_out;
390 zlib_deflateEnd(&c->zstream);
395 kfree(c->zstream.workspace);