CMakeLists.txt | 2 ++ cmake/modules/Finduring.cmake | 2 +- cmake/modules/Findzstd.cmake | 25 +++++++++++++++++ src/common/options.cc | 2 +- src/compressor/zstd/CMakeLists.txt | 25 +---------------- src/compressor/zstd/ZstdCompressor.h | 2 +- src/include/buffer.h | 4 ++- src/include/rados/librados.h | 6 ---- src/init-ceph.in | 1 - src/kv/rocksdb_cache/BinnedLRUCache.cc | 28 ++++++++++++++++--- src/kv/rocksdb_cache/BinnedLRUCache.h | 18 ++++++++---- src/kv/rocksdb_cache/ShardedCache.cc | 29 ++++++++++++++++++-- src/kv/rocksdb_cache/ShardedCache.h | 50 ++++++++++++++++++++++------------ 13 files changed, 130 insertions(+), 64 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 78cae841bb6..ab25ce8743e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -334,6 +334,8 @@ if(WITH_LZ4) set(HAVE_LZ4 ${LZ4_FOUND}) endif(WITH_LZ4) +find_package(zstd REQUIRED) + option(WITH_CEPH_DEBUG_MUTEX "Use debug ceph::mutex with lockdep" OFF) #if allocator is set on command line make sure it matches below strings diff --git a/cmake/modules/Finduring.cmake b/cmake/modules/Finduring.cmake index 10c8de42550..8e11c273a2d 100644 --- a/cmake/modules/Finduring.cmake +++ b/cmake/modules/Finduring.cmake @@ -5,7 +5,7 @@ # uring_FOUND - True if uring found. find_path(URING_INCLUDE_DIR liburing.h) -find_library(URING_LIBRARIES liburing.a liburing) +find_library(URING_LIBRARIES liburing.so liburing) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(uring DEFAULT_MSG URING_LIBRARIES URING_INCLUDE_DIR) diff --git a/cmake/modules/Findzstd.cmake b/cmake/modules/Findzstd.cmake new file mode 100644 index 00000000000..696bb7603e2 --- /dev/null +++ b/cmake/modules/Findzstd.cmake @@ -0,0 +1,25 @@ +# Try to find liblz4 +# +# Once done, this will define +# +# ZSTD_FOUND +# ZSTD_INCLUDE_DIR +# ZSTD_LIBRARY + +find_path(ZSTD_INCLUDE_DIR zstd.h) + +find_library(ZSTD_LIBRARY zstd) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(zstd + DEFAULT_MSG ZSTD_LIBRARY ZSTD_INCLUDE_DIR) + +mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY) + +if(ZSTD_FOUND AND NOT (TARGET zstd::zstd)) + add_library(zstd::zstd UNKNOWN IMPORTED) + set_target_properties(zstd::zstd PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIR}" + IMPORTED_LINK_INTERFACE_LANGUAGES "C" + IMPORTED_LOCATION "${ZSTD_LIBRARY}") +endif() diff --git a/src/common/options.cc b/src/common/options.cc index b0239e24aa4..bff4154decd 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -5543,7 +5543,7 @@ std::vector