Feature #43324
closedMake zlib windowBits configurable for compression
0%
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
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
Updated by Igor Fedotov almost 4 years ago
- Status changed from New to Fix Under Review
- Pull request ID set to 34852
Updated by Kefu Chai almost 4 years ago
- Status changed from Fix Under Review to Resolved