From 2b9c79e881de0ce53954999700a5551af9052ee9 Mon Sep 17 00:00:00 2001 From: Matan Breizman Date: Wed, 5 Feb 2025 17:35:38 +0000 Subject: [PATCH] os: Introduce WITH_KSTORE Previosuly, we used WITH_SEASTAR to not include KStore with Crimson. As now Crimson's Alienstore is not defined WITH_SEASTAR We need to be able to not include KStore to alien crimson target as well. Instead, let Classic define PRIVATE WITH_KSTORE that will not be used by the alien targets. This doesn't change anything of non-crimson targets. Signed-off-by: Matan Breizman --- src/os/CMakeLists.txt | 1 + src/os/ObjectStore.cc | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/os/CMakeLists.txt b/src/os/CMakeLists.txt index 71452e542bbcd..acd98ef55a9b4 100644 --- a/src/os/CMakeLists.txt +++ b/src/os/CMakeLists.txt @@ -47,6 +47,7 @@ target_link_libraries(os blk ${FMT_LIB}) +target_compile_definitions(os PRIVATE -DWITH_KSTORE) target_link_libraries(os heap_profiler kv) if(WITH_BLUEFS) diff --git a/src/os/ObjectStore.cc b/src/os/ObjectStore.cc index 9e25979b71654..cf8666b79d4d5 100644 --- a/src/os/ObjectStore.cc +++ b/src/os/ObjectStore.cc @@ -21,7 +21,7 @@ #if defined(WITH_BLUESTORE) #include "bluestore/BlueStore.h" #endif -#ifndef WITH_SEASTAR +#ifdef WITH_KSTORE #include "kstore/KStore.h" #endif @@ -43,7 +43,6 @@ std::unique_ptr ObjectStore::create( return nullptr; } -#ifndef WITH_SEASTAR std::unique_ptr ObjectStore::create( CephContext *cct, const string& type, @@ -55,13 +54,15 @@ std::unique_ptr ObjectStore::create( lgeneric_derr(cct) << __func__ << ": FileStore has been deprecated and is no longer supported" << dendl; return nullptr; } + #ifdef WITH_KSTORE if (type == "kstore" && cct->check_experimental_feature_enabled("kstore")) { return std::make_unique(cct, data); } + #endif return create(cct, type, data); } -#endif + int ObjectStore::probe_block_device_fsid( CephContext *cct, -- 2.39.5