]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
compressor: fix compile error for QAT
authorQiaowei Ren <qiaowei.ren@intel.com>
Tue, 4 Aug 2020 03:36:38 +0000 (11:36 +0800)
committerQiaowei Ren <qiaowei.ren@intel.com>
Fri, 14 Aug 2020 08:34:53 +0000 (16:34 +0800)
With '-DWITH_QATZIP=ON', Ceph could not be compiled successfully because
of the change of bufferptr API and QATzip library link.

Signed-off-by: Qiaowei Ren <qiaowei.ren@intel.com>
src/compressor/CMakeLists.txt
src/compressor/QatAccel.cc
src/compressor/QatAccel.h
src/compressor/lz4/CMakeLists.txt
src/compressor/snappy/CMakeLists.txt
src/compressor/zlib/CMakeLists.txt

index 494bcc44749c2504f1ea344ac657da3ee1921e76..d8b9fd83cdace12bb9db502f4569dcfa18e257f8 100644 (file)
@@ -22,6 +22,11 @@ if(HAVE_BROTLI)
   add_subdirectory(brotli)
 endif()
 
+add_library(compressor STATIC ${compressor_srcs})
+if(HAVE_QATZIP)
+  target_link_libraries(compressor PRIVATE ${QATZIP_LIBRARIES})
+endif()
+
 set(ceph_compressor_libs
     ceph_snappy
     ceph_zlib
index fff9e34e846b101ca41017fd81f8f4b07a51ca2e..28e86e94e8cd2adf47d60313d820c504c1dea637 100644 (file)
@@ -113,7 +113,7 @@ int QatAccel::decompress(bufferlist::const_iterator &p,
     if (rc == QZ_DATA_ERROR) {
       if (!joint) {
         tmp.append(cur_ptr.c_str(), cur_ptr.length());
-        p.advance(remaining);
+        p += remaining;
         joint = true;
       }
       read_more = true;
@@ -133,7 +133,7 @@ int QatAccel::decompress(bufferlist::const_iterator &p,
       read_more = false;
     }
 
-    p.advance(remaining);
+    p += remaining;
     remaining -= len;
     dst.append(ptr, 0, out_len);
   }
index f15e3303701764760c80e9e191a1479e3ce1a802..3f7ccd25d10cb3f91e53937609310c551d672230 100644 (file)
@@ -16,6 +16,7 @@
 #define CEPH_QATACCEL_H
 
 #include <qatzip.h>
+#include <boost/optional.hpp>
 #include "include/buffer.h"
 
 class QatAccel {
index 7a8a15d674fc9e2c0361c642729c6d1305236f5f..2341ce5aef7926525246125c0dcdd8e3ba38ceff 100644 (file)
@@ -5,7 +5,7 @@ set(lz4_sources
 )
 
 add_library(ceph_lz4 SHARED ${lz4_sources})
-target_link_libraries(ceph_lz4 PRIVATE LZ4::LZ4)
+target_link_libraries(ceph_lz4 PRIVATE LZ4::LZ4 compressor)
 set_target_properties(ceph_lz4 PROPERTIES
   VERSION 2.0.0
   SOVERSION 2
index 0bb233d4cde5b0f1e7db5a118c32e11652f34ec4..5396e03f1ead0450594e217242552eb41b2c68e6 100644 (file)
@@ -5,7 +5,7 @@ set(snappy_sources
 )
 
 add_library(ceph_snappy SHARED ${snappy_sources})
-target_link_libraries(ceph_snappy PRIVATE snappy::snappy)
+target_link_libraries(ceph_snappy PRIVATE snappy::snappy compressor)
 set_target_properties(ceph_snappy PROPERTIES
   VERSION 2.0.0
   SOVERSION 2
index 346f37137ce9064cd7b2fd11fb0830cc30583da2..c357c326660088b0590449536d88f7e08c08c7ab 100644 (file)
@@ -49,7 +49,7 @@ else(HAVE_INTEL_SSE4_1 AND HAVE_BETTER_YASM_ELF64 AND (NOT APPLE))
 endif(HAVE_INTEL_SSE4_1 AND HAVE_BETTER_YASM_ELF64 AND (NOT APPLE))
 
 add_library(ceph_zlib SHARED ${zlib_sources})
-target_link_libraries(ceph_zlib ZLIB::ZLIB)
+target_link_libraries(ceph_zlib ZLIB::ZLIB compressor)
 target_include_directories(ceph_zlib SYSTEM PRIVATE "${CMAKE_SOURCE_DIR}/src/isa-l/include")
 set_target_properties(ceph_zlib PROPERTIES
   VERSION 2.0.0