Commit 0ed2a120 authored by Ben Walker's avatar Ben Walker Committed by Jim Harris
Browse files

bdev/aio: Keep a pointer to the channel on the aio_task



This will be used later.

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
parent 7f534fca
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -48,12 +48,6 @@

#include <libaio.h>

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);