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: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/443310 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
6ced440ad6
commit
7ffbf85dab
@ -66,8 +66,11 @@ struct bdev_aio_io_channel {
|
||||
};
|
||||
|
||||
struct bdev_aio_group_channel {
|
||||
struct spdk_poller *poller;
|
||||
int epfd;
|
||||
struct spdk_poller *poller;
|
||||
|
||||
TAILQ_HEAD(, bdev_aio_io_channel) channels;
|
||||
|
||||
int epfd;
|
||||
};
|
||||
|
||||
struct file_disk {
|
||||
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user