]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
compressor/ZLibCompressor: fix broken isal-l
authorIgor Fedotov <ifedotov@mirantis.com>
Wed, 12 Oct 2016 13:38:26 +0000 (13:38 +0000)
committerIgor Fedotov <ifedotov@mirantis.com>
Wed, 12 Oct 2016 13:38:26 +0000 (13:38 +0000)
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
src/compressor/zlib/ZlibCompressor.cc
src/test/compressor/test_compression.cc

index b7c33a20adcb837b1d6c550fd347bee047e6cfd8..cb8c0b06d31028269e49ba0d3d5db7e1b9172eb9 100644 (file)
@@ -84,7 +84,7 @@ int ZlibCompressor::zlib_compress(const bufferlist &in, bufferlist &out)
       strm.next_out = (unsigned char*)ptr.c_str() + begin;
       strm.avail_out = MAX_LEN - begin;
       if (begin) {
-        // put a compressor variation mark in front of compressed stream
+        // put a compressor variation mark in front of compressed stream, not used at the moment
         ptr.c_str()[0] = 0;
         begin = 0;
       }
@@ -140,7 +140,7 @@ int ZlibCompressor::isal_compress(const bufferlist &in, bufferlist &out)
       strm.next_out = (unsigned char*)ptr.c_str() + begin;
       strm.avail_out = MAX_LEN - begin;
       if (begin) {
-        // put a compressor variation mark in front of compressed stream
+        // put a compressor variation mark in front of compressed stream, not used at the moment
         ptr.c_str()[0] = 1;
         begin = 0;
       }
@@ -191,10 +191,7 @@ int ZlibCompressor::decompress(bufferlist::iterator &p, size_t compressed_size,
   strm.next_in = Z_NULL;
 
   // choose the variation of compressor
-  if (*p == 1)
-    ret = inflateInit2(&strm, -HIST_SIZE);
-  else
-    ret = inflateInit2(&strm, ZLIB_DEFAULT_WIN_SIZE);
+  ret = inflateInit2(&strm, ZLIB_DEFAULT_WIN_SIZE);
   if (ret != Z_OK) {
     dout(1) << "Decompression init error: init return "
          << ret << " instead of Z_OK" << dendl;
index f62c2b2672f88d306833606830f2b44c6edadddf..464427a2aa33f42039af81f56b2bc7625eacbdde 100644 (file)
@@ -324,7 +324,7 @@ INSTANTIATE_TEST_CASE_P(
   Compressor,
   CompressorTest,
   ::testing::Values(
-//    "zlib/isal",
+    "zlib/isal",
     "zlib/noisal",
     "snappy"));