From: Qiaowei Ren Date: Tue, 4 Aug 2020 03:36:38 +0000 (+0800) Subject: compressor: fix compile error for QAT X-Git-Tag: v16.1.0~1384^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dd00821c05c14d2f59548684a0e68436cba038c7;p=ceph.git compressor: fix compile error for QAT 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 --- diff --git a/src/compressor/CMakeLists.txt b/src/compressor/CMakeLists.txt index 494bcc44749c..d8b9fd83cdac 100644 --- a/src/compressor/CMakeLists.txt +++ b/src/compressor/CMakeLists.txt @@ -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 diff --git a/src/compressor/QatAccel.cc b/src/compressor/QatAccel.cc index fff9e34e846b..28e86e94e8cd 100644 --- a/src/compressor/QatAccel.cc +++ b/src/compressor/QatAccel.cc @@ -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); } diff --git a/src/compressor/QatAccel.h b/src/compressor/QatAccel.h index f15e33037017..3f7ccd25d10c 100644 --- a/src/compressor/QatAccel.h +++ b/src/compressor/QatAccel.h @@ -16,6 +16,7 @@ #define CEPH_QATACCEL_H #include +#include #include "include/buffer.h" class QatAccel { diff --git a/src/compressor/lz4/CMakeLists.txt b/src/compressor/lz4/CMakeLists.txt index 7a8a15d674fc..2341ce5aef79 100644 --- a/src/compressor/lz4/CMakeLists.txt +++ b/src/compressor/lz4/CMakeLists.txt @@ -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 diff --git a/src/compressor/snappy/CMakeLists.txt b/src/compressor/snappy/CMakeLists.txt index 0bb233d4cde5..5396e03f1ead 100644 --- a/src/compressor/snappy/CMakeLists.txt +++ b/src/compressor/snappy/CMakeLists.txt @@ -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 diff --git a/src/compressor/zlib/CMakeLists.txt b/src/compressor/zlib/CMakeLists.txt index 346f37137ce9..c357c3266600 100644 --- a/src/compressor/zlib/CMakeLists.txt +++ b/src/compressor/zlib/CMakeLists.txt @@ -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