]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Build: create a proper WITH_BLUESTORE option 18357/head
authorAlan Somers <asomers@gmail.com>
Thu, 12 Oct 2017 20:41:47 +0000 (14:41 -0600)
committerAlan Somers <asomers@gmail.com>
Wed, 18 Oct 2017 16:20:06 +0000 (10:20 -0600)
Using Bluestore is not the same thing as having libaio, especially on
non-Linux platforms.

Signed-off-by: Alan Somers <asomers@gmail.com>
CMakeLists.txt
do_freebsd.sh
src/include/config-h.in.cmake
src/os/CMakeLists.txt
src/os/ObjectStore.cc
src/test/encoding/types.h
src/test/objectstore/CMakeLists.txt
src/test/objectstore/store_test.cc
src/test/objectstore/store_test_fixture.cc
src/tools/ceph_kvstore_tool.cc

index 9ff17a8f754f753f41b9037d35230587832cae3a..5b5e6a46247c71ad83807189ea766644996ba9bf 100644 (file)
@@ -180,21 +180,21 @@ find_package(Backtrace)
 if(LINUX)
   find_package(udev REQUIRED)
   set(HAVE_UDEV ${UDEV_FOUND})
-
-  find_package(aio REQUIRED)
-  set(HAVE_LIBAIO ${AIO_FOUND})
-
   find_package(blkid REQUIRED)
   set(HAVE_BLKID ${BLKID_FOUND})
 else()
   set(HAVE_UDEV OFF)
   message(STATUS "Not using udev")
-  set(HAVE_LIBAIO OFF)
-  message(STATUS "Not using AIO")
   set(HAVE_BLKID OFF)
   message(STATUS "Not using BLKID")
 endif(LINUX)
 
+option(WITH_BLUESTORE "Bluestore OSD backend" ON)
+if(${WITH_BLUESTORE})
+  find_package(aio REQUIRED)
+  set(HAVE_LIBAIO ${AIO_FOUND})
+endif(${WITH_BLUESTORE})
+
 option(WITH_OPENLDAP "OPENLDAP is here" ON)
 if(${WITH_OPENLDAP})
 find_package(OpenLdap REQUIRED)
index 2cfa8fa6a7c7dd13839cee93e0f7c0eae36e4283..fd8c5b450d585e8b8252345bd6e48f77050bb577 100755 (executable)
@@ -23,6 +23,7 @@ rm -rf build && ./do_cmake.sh "$*" \
        -D WITH_SYSTEM_BOOST=ON \
        -D WITH_LTTNG=OFF \
        -D WITH_BLKID=OFF \
+       -D WITH_BLUESTORE=OFF \
        -D WITH_FUSE=ON \
        -D WITH_KRBD=OFF \
        -D WITH_XFS=OFF \
index f97157a5123257fd0182c7e3c3ae46b03bbd4190..ed082088057404bf2a332a276bd4e0a7d662d880 100644 (file)
 /* ibverbs experimental conditional compilation */
 #cmakedefine HAVE_IBV_EXP
 
+/* define if bluestore enabled */
+#cmakedefine WITH_BLUESTORE
+
 /* define if embedded enabled */
 #cmakedefine WITH_EMBEDDED
 
index ad2940449ac2018fd4088c89b18fa77a12a3d2d4..131a467756e697b5f7b03de7067d6e7b6c4ba2da 100644 (file)
@@ -18,7 +18,7 @@ set(libos_srcs
   kstore/kstore_types.cc
   fs/FS.cc)
 
-if(HAVE_LIBAIO)
+if(WITH_BLUESTORE)
   list(APPEND libos_srcs
     bluestore/Allocator.cc
     bluestore/BitmapFreelistManager.cc
@@ -35,7 +35,7 @@ if(HAVE_LIBAIO)
     bluestore/BitAllocator.cc
     bluestore/aio.cc
   )
-endif(HAVE_LIBAIO)
+endif(WITH_BLUESTORE)
 
 if(WITH_FUSE)
   list(APPEND libos_srcs
@@ -112,7 +112,7 @@ add_dependencies(os compressor_plugins)
 add_dependencies(os crypto_plugins)
 
 
-if(HAVE_LIBAIO)
+if(WITH_BLUESTORE)
   add_executable(ceph-bluestore-tool
     bluestore/bluestore_tool.cc)
   target_link_libraries(ceph-bluestore-tool
index 93c79667d4f171c3fa18b13e6c8ab6800d0bfccc..7bf29be97cb8d402ea1946964734f34b7802e12a 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "filestore/FileStore.h"
 #include "memstore/MemStore.h"
-#if defined(HAVE_LIBAIO)
+#if defined(WITH_BLUESTORE)
 #include "bluestore/BlueStore.h"
 #endif
 #include "kstore/KStore.h"
@@ -72,7 +72,7 @@ ObjectStore *ObjectStore::create(CephContext *cct,
   if (type == "memstore") {
     return new MemStore(cct, data);
   }
-#if defined(HAVE_LIBAIO)
+#if defined(WITH_BLUESTORE)
   if (type == "bluestore") {
     return new BlueStore(cct, data);
   }
@@ -102,7 +102,7 @@ int ObjectStore::probe_block_device_fsid(
 {
   int r;
 
-#if defined(HAVE_LIBAIO)
+#if defined(WITH_BLUESTORE)
   // first try bluestore -- it has a crc on its header and will fail
   // reliably.
   r = BlueStore::get_block_device_fsid(cct, path, fsid);
index 092dd40322dd9b8b7ee65a7ae1ed5780cdd073d7..5a0f8b7fe8d4f00496f1e0f96e8294e0804695e8 100644 (file)
@@ -117,7 +117,7 @@ TYPE(ObjectStore::Transaction)
 #include "os/filestore/SequencerPosition.h"
 TYPE(SequencerPosition)
 
-#ifdef HAVE_LIBAIO
+#ifdef WITH_BLUESTORE
 #include "os/bluestore/bluestore_types.h"
 TYPE(bluestore_cnode_t)
 TYPE(bluestore_compression_header_t)
index cd361e02ccca126f29e1a67e251458f0298607b1..5e0202197bed7fa890271357a9f390107426cb39 100644 (file)
@@ -107,7 +107,7 @@ add_executable(unittest_rocksdb_option
 add_ceph_unittest(unittest_rocksdb_option)
 target_link_libraries(unittest_rocksdb_option global os ${BLKID_LIBRARIES})
 
-if(HAVE_LIBAIO)
+if(WITH_BLUESTORE)
   # unittest_bit_alloc
   add_executable(unittest_bit_alloc
     BitAllocator_test.cc
@@ -136,7 +136,7 @@ if(HAVE_LIBAIO)
     )
   add_ceph_unittest(unittest_bluestore_types)
   target_link_libraries(unittest_bluestore_types os global)
-endif(HAVE_LIBAIO)
+endif(WITH_BLUESTORE)
 
 # unittest_transaction
 add_executable(unittest_transaction
index d549007b96b7244a295f1f40b09186ee7b429142..2fcb47140fa66e3edc304126d2a964fe7315b1ae 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "os/ObjectStore.h"
 #include "os/filestore/FileStore.h"
-#if defined(HAVE_LIBAIO)
+#if defined(WITH_BLUESTORE)
 #include "os/bluestore/BlueStore.h"
 #endif
 #include "include/Context.h"
@@ -1327,7 +1327,7 @@ TEST_P(StoreTest, SimpleObjectTest) {
   }
 }
 
-#if defined(HAVE_LIBAIO)
+#if defined(WITH_BLUESTORE)
 TEST_P(StoreTestSpecificAUSize, BluestoreStatFSTest) {
   if(string(GetParam()) != "bluestore")
     return;
@@ -5523,7 +5523,7 @@ TEST_P(StoreTest, TryMoveRename) {
   ASSERT_EQ(store->stat(cid, hoid2, &st), 0);
 }
 
-#if defined(HAVE_LIBAIO)
+#if defined(WITH_BLUESTORE)
 TEST_P(StoreTest, BluestoreOnOffCSumTest) {
   if (string(GetParam()) != "bluestore")
     return;
@@ -5712,7 +5712,7 @@ INSTANTIATE_TEST_CASE_P(
   ::testing::Values(
     "memstore",
     "filestore",
-#if defined(HAVE_LIBAIO)
+#if defined(WITH_BLUESTORE)
     "bluestore",
 #endif
     "kstore"));
@@ -5724,7 +5724,7 @@ INSTANTIATE_TEST_CASE_P(
   ::testing::Values(
     "memstore",
     "filestore",
-#if defined(HAVE_LIBAIO)
+#if defined(WITH_BLUESTORE)
     "bluestore",
 #endif
     "kstore"));
@@ -5823,7 +5823,7 @@ TEST_P(StoreTestSpecificAUSize, TooManyBlobsTest) {
   ASSERT_EQ(res_stat.allocated, max_object);
 }
 
-#if defined(HAVE_LIBAIO)
+#if defined(WITH_BLUESTORE)
 void get_mempool_stats(uint64_t* total_bytes, uint64_t* total_items)
 {
   uint64_t onode_allocated = mempool::bluestore_cache_onode::allocated_bytes();
@@ -6464,7 +6464,7 @@ TEST_P(StoreTestSpecificAUSize, SmallWriteOnShardedExtents) {
   g_conf->set_val("bluestore_csum_type", "crc32c");
 }
 
-#endif //#if defined(HAVE_LIBAIO)
+#endif //#if defined(WITH_BLUESTORE)
 
 TEST_P(StoreTest, KVDBHistogramTest) {
   if (string(GetParam()) != "bluestore")
@@ -6549,7 +6549,7 @@ TEST_P(StoreTest, KVDBStatsTest) {
   g_conf->set_val("rocksdb_collect_memory_stats","false");
 }
 
-#if defined(HAVE_LIBAIO)
+#if defined(WITH_BLUESTORE)
 TEST_P(StoreTestSpecificAUSize, garbageCollection) {
   ObjectStore::Sequencer osr("test");
   int r;
index e80bde8315e7674ee4520c251cd9745ce88b4cd8..b8875eaa00d71b874bd2ae6eb1264480f47dc77a 100644 (file)
@@ -5,7 +5,7 @@
 
 #include "common/errno.h"
 #include "os/ObjectStore.h"
-#if defined(HAVE_LIBAIO)
+#if defined(WITH_BLUESTORE)
 #include "os/bluestore/BlueStore.h"
 #endif
 #include "store_test_fixture.h"
@@ -42,7 +42,7 @@ void StoreTestFixture::SetUp() {
     cerr << __func__ << ": objectstore type " << type << " doesn't exist yet!" << std::endl;
   }
   ASSERT_TRUE(store);
-#if defined(HAVE_LIBAIO)
+#if defined(WITH_BLUESTORE)
   if (type == "bluestore") {
     BlueStore *s = static_cast<BlueStore*>(store.get());
     // better test coverage!
index 90a8798b7fdc91d71a1f84a03a2ed7df40843d77..6d4288da54454fcbfb19c7f3df04ca65d298d5f3 100644 (file)
@@ -28,7 +28,7 @@
 #include "kv/KeyValueDB.h"
 #include "common/url_escape.h"
 
-#ifdef HAVE_LIBAIO
+#ifdef WITH_BLUESTORE
 #include "os/bluestore/BlueStore.h"
 #endif
 
@@ -36,7 +36,7 @@ using namespace std;
 
 class StoreTool
 {
-#ifdef HAVE_LIBAIO
+#ifdef WITH_BLUESTORE
   struct Deleter {
     BlueStore *bluestore;
     Deleter(BlueStore *store = nullptr)
@@ -61,7 +61,7 @@ class StoreTool
   public:
   StoreTool(string type, const string &path, bool need_open_db=true) : store_path(path) {
     if (type == "bluestore-kv") {
-#ifdef HAVE_LIBAIO
+#ifdef WITH_BLUESTORE
       auto bluestore = new BlueStore(g_ceph_context, path, need_open_db);
       KeyValueDB *db_ptr;
       int r = bluestore->start_kv_only(&db_ptr);