Project

General

Profile

Actions

Feature #43324

closed

Make zlib windowBits configurable for compression

Added by Xiyuan Wang over 4 years ago. Updated almost 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Administration/Usability
Target version:
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Reviewed:
Affected Versions:
Component(RADOS):
Pull request ID:

Description

Now the zlib windowBits is hardcoding as -151. But it should be set to different value for different case.

According to zlib guide2, windowBits can be set to [-15, -8) for raw deflate, (8, 15] for compression with header and trailer and [16,) for optional gzip encoding.

And now we meet an requirement to use 15 for zlib windowBits.

So for Ceph, is it possible to make `ZLIB_DEFAULT_WIN_SIZE` configurable to support different compression case?

[1]: https://github.com/ceph/ceph/blob/master/src/compressor/zlib/ZlibCompressor.cc#L43
[2]: https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da3b647f07d718623f/zlib.h#L552-L576

Actions #1

Updated by Xiyuan Wang over 4 years ago

Xiyuan Wang wrote:

Now the zlib windowBits is hardcoding as -151. But it should be set to different value for different case.

According to zlib guide2, windowBits can be set to [-15, -8) for raw deflate, (8, 15] for compression with header and trailer and [16,) for optional gzip encoding.

And now we meet an requirement to use 15 for zlib windowBits.

So for Ceph community, is it possible to make `ZLIB_DEFAULT_WIN_SIZE` configurable to support different compression case? If yes, I can contribute the code to upstream.

[1]: https://github.com/ceph/ceph/blob/master/src/compressor/zlib/ZlibCompressor.cc#L43
[2]: https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da3b647f07d718623f/zlib.h#L552-L576

Actions #2

Updated by Igor Fedotov almost 4 years ago

  • Status changed from New to Fix Under Review
  • Pull request ID set to 34852
Actions #3

Updated by Kefu Chai almost 4 years ago

  • Status changed from Fix Under Review to Resolved
Actions

Also available in: Atom PDF