Commit 7ffbf85d authored by Ben Walker's avatar Ben Walker Committed by Jim Harris
Browse files

bdev/aio: Store channels in a list in the group channel



This isn't used just yet, but will be necessary temporarily
during this patch series.

Change-Id: I7f04426c27e3fe0417e2f60bac28217fa44c0cb2
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/443310


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 6ced440a
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -67,6 +67,9 @@ struct bdev_aio_io_channel {

struct bdev_aio_group_channel {
	struct spdk_poller			*poller;

	TAILQ_HEAD(, bdev_aio_io_channel)	channels;

	int					epfd;
};

@@ -441,6 +444,9 @@ bdev_aio_create_cb(void *io_device, void *ctx_buf)
		SPDK_ERRLOG("epoll_ctl error\n");
		return -1;
	}

	TAILQ_INSERT_TAIL(&group_ch_ctx->channels, ch, link);

	return 0;
}

@@ -453,6 +459,7 @@ bdev_aio_destroy_cb(void *io_device, void *ctx_buf)

	group_ch_ctx = spdk_io_channel_get_ctx(io_channel->group_ch);
	epoll_ctl(group_ch_ctx->epfd, EPOLL_CTL_DEL, io_channel->efd, &event);
	TAILQ_REMOVE(&group_ch_ctx->channels, io_channel, link);
	spdk_put_io_channel(io_channel->group_ch);
	close(io_channel->efd);
	io_destroy(io_channel->io_ctx);
@@ -526,6 +533,8 @@ bdev_aio_group_create_cb(void *io_device, void *ctx_buf)
{
	struct bdev_aio_group_channel *ch = ctx_buf;

	TAILQ_INIT(&ch->channels);

	ch->epfd = epoll_create1(0);
	if (ch->epfd == -1) {
		SPDK_ERRLOG("cannot create epoll fd\n");