From 993ab4908c73d337a97f91ecdc9cd0ad493332bb Mon Sep 17 00:00:00 2001 From: Chunyang Hui Date: Thu, 4 Jul 2019 15:58:53 -0400 Subject: [PATCH] RocksDB: Remove static and assert for SpdkInitializeThread RocksDB spdk-v5.13.4 and spdk-v5.18.4 still need to call SpdkInitializeThread in its env init. Static will trigger make error. Thus removed. For removing assert, we already have enough check to make sure the allocate won't happen twice. The assert here is redundant. Signed-off-by: Chunyang Hui Change-Id: I058c580349398b83fed8a8408b089e065b5d2988 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460465 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto --- lib/rocksdb/env_spdk.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/rocksdb/env_spdk.cc b/lib/rocksdb/env_spdk.cc index 42b8235ef..095fa37d7 100644 --- a/lib/rocksdb/env_spdk.cc +++ b/lib/rocksdb/env_spdk.cc @@ -59,7 +59,7 @@ std::string g_bdev_name; volatile bool g_spdk_ready = false; volatile bool g_spdk_start_failure = false; -static void SpdkInitializeThread(void); +void SpdkInitializeThread(void); class SpdkThreadCtx { @@ -638,11 +638,10 @@ public: * SpdkInitializeThread function, so that the main thread can explicitly * call it after the filesystem has been loaded. */ -static void SpdkInitializeThread(void) +void SpdkInitializeThread(void) { struct spdk_thread *thread; - assert(g_sync_args.channel == NULL); if (g_fs != NULL) { thread = spdk_thread_create("spdk_rocksdb", NULL); spdk_set_thread(thread);