module/bdev: Initialize global TAILQ HEAD variables at definition.

Signed-off-by: yidong0635 <dongx.yi@intel.com>
Change-Id: I957e6a72878fa6c523942710544de981202fa311
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4596
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:18:16 -04:00 committed by Tomasz Zawadzki
parent e1a9774cdc
commit 232bfc75e0
3 changed files with 3 additions and 7 deletions

View File

@ -99,7 +99,7 @@ static int bdev_aio_initialize(void);
static void bdev_aio_fini(void);
static void aio_free_disk(struct file_disk *fdisk);
static void bdev_aio_get_spdk_running_config(FILE *fp);
static TAILQ_HEAD(, file_disk) g_aio_disk_head;
static TAILQ_HEAD(, file_disk) g_aio_disk_head = TAILQ_HEAD_INITIALIZER(g_aio_disk_head);
#define SPDK_AIO_QUEUE_DEPTH 128
#define MAX_EVENTS_PER_POLL 32
@ -759,7 +759,6 @@ bdev_aio_initialize(void)
struct spdk_conf_section *sp;
int rc = 0;
TAILQ_INIT(&g_aio_disk_head);
spdk_io_device_register(&aio_if, bdev_aio_group_create_cb, bdev_aio_group_destroy_cb,
sizeof(struct bdev_aio_group_channel),
"aio_module");

View File

@ -56,7 +56,7 @@ struct null_io_channel {
TAILQ_HEAD(, spdk_bdev_io) io;
};
static TAILQ_HEAD(, null_bdev) g_null_bdev_head;
static TAILQ_HEAD(, null_bdev) g_null_bdev_head = TAILQ_HEAD_INITIALIZER(g_null_bdev_head);
static void *g_null_read_buf;
static int bdev_null_initialize(void);
@ -416,8 +416,6 @@ bdev_null_initialize(void)
const char *name, *val;
struct spdk_null_bdev_opts opts = {};
TAILQ_INIT(&g_null_bdev_head);
/*
* This will be used if upper layer expects us to allocate the read buffer.
* Instead of using a real rbuf from the bdev pool, just always point to

View File

@ -77,7 +77,7 @@ static int bdev_uring_init(void);
static void bdev_uring_fini(void);
static void uring_free_bdev(struct bdev_uring *uring);
static void bdev_uring_get_spdk_running_config(FILE *fp);
static TAILQ_HEAD(, bdev_uring) g_uring_bdev_head;
static TAILQ_HEAD(, bdev_uring) g_uring_bdev_head = TAILQ_HEAD_INITIALIZER(g_uring_bdev_head);
#define SPDK_URING_QUEUE_DEPTH 512
#define MAX_EVENTS_PER_POLL 32
@ -581,7 +581,6 @@ bdev_uring_init(void)
struct spdk_conf_section *sp;
struct spdk_bdev *bdev;
TAILQ_INIT(&g_uring_bdev_head);
spdk_io_device_register(&uring_if, bdev_uring_group_create_cb, bdev_uring_group_destroy_cb,
sizeof(struct bdev_uring_group_channel),
"uring_module");