lib/blobfs: Initialize global TAILQ HEAD variable at definition.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I3306e38781ceb2e98fbf9e62c4e02dd010ce62f4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4598
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
yidong0635 2020-10-12 11:23:40 -04:00 committed by Tomasz Zawadzki
parent a3d1419b05
commit 55478de6e4

View File

@ -58,7 +58,7 @@
static uint64_t g_fs_cache_size = BLOBFS_DEFAULT_CACHE_SIZE;
static struct spdk_mempool *g_cache_pool;
static TAILQ_HEAD(, spdk_file) g_caches;
static TAILQ_HEAD(, spdk_file) g_caches = TAILQ_HEAD_INITIALIZER(g_caches);
static struct spdk_poller *g_cache_pool_mgmt_poller;
static struct spdk_thread *g_cache_pool_thread;
#define BLOBFS_CACHE_POOL_POLL_PERIOD_IN_US 1000ULL
@ -292,7 +292,6 @@ __start_cache_pool_mgmt(void *ctx)
"increase the memory and try again\n");
assert(false);
}
TAILQ_INIT(&g_caches);
assert(g_cache_pool_mgmt_poller == NULL);
g_cache_pool_mgmt_poller = SPDK_POLLER_REGISTER(_blobfs_cache_pool_reclaim, NULL,