From 0ed2a120b3ad22a6ec083cc84aeaa4ddf0125e08 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Mon, 4 Feb 2019 14:27:53 -0700 Subject: [PATCH] bdev/aio: Keep a pointer to the channel on the aio_task This will be used later. Change-Id: I12b07756a13d03a34c9705306d720c1db7ecb15c Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/443312 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris Reviewed-by: Paul Luse --- lib/bdev/aio/bdev_aio.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/bdev/aio/bdev_aio.c b/lib/bdev/aio/bdev_aio.c index c077a52e2..4bc67a1ba 100644 --- a/lib/bdev/aio/bdev_aio.c +++ b/lib/bdev/aio/bdev_aio.c @@ -48,12 +48,6 @@ #include -struct bdev_aio_task { - struct iocb iocb; - uint64_t len; - TAILQ_ENTRY(bdev_aio_task) link; -}; - struct bdev_aio_io_channel { io_context_t io_ctx; uint64_t io_inflight; @@ -67,6 +61,13 @@ struct bdev_aio_group_channel { TAILQ_HEAD(, bdev_aio_io_channel) channels; }; +struct bdev_aio_task { + struct iocb iocb; + uint64_t len; + struct bdev_aio_io_channel *ch; + TAILQ_ENTRY(bdev_aio_task) link; +}; + struct file_disk { struct bdev_aio_task *reset_task; struct spdk_poller *reset_retry_timer; @@ -157,6 +158,7 @@ bdev_aio_readv(struct file_disk *fdisk, struct spdk_io_channel *ch, io_prep_preadv(iocb, fdisk->fd, iov, iovcnt, offset); iocb->data = aio_task; aio_task->len = nbytes; + aio_task->ch = aio_ch; SPDK_DEBUGLOG(SPDK_LOG_AIO, "read %d iovs size %lu to off: %#lx\n", iovcnt, nbytes, offset); @@ -187,6 +189,7 @@ bdev_aio_writev(struct file_disk *fdisk, struct spdk_io_channel *ch, io_prep_pwritev(iocb, fdisk->fd, iov, iovcnt, offset); iocb->data = aio_task; aio_task->len = len; + aio_task->ch = aio_ch; SPDK_DEBUGLOG(SPDK_LOG_AIO, "write %d iovs size %lu from off: %#lx\n", iovcnt, len, offset);