Commit 232bfc75 authored by yidong0635's avatar yidong0635 Committed by Tomasz Zawadzki
Browse files

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



Signed-off-by: default avataryidong0635 <dongx.yi@intel.com>
Change-Id: I957e6a72878fa6c523942710544de981202fa311
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4596


Reviewed-by: default avatarAleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent e1a9774c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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");
+1 −3
Original line number Diff line number Diff line
@@ -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
+1 −2
Original line number Diff line number Diff line
@@ -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");