Commit 670db760 authored by Jim Harris's avatar Jim Harris
Browse files

test/reduce: add indirection in read/write/unmap callback path



This sets up for future patches to allow these I/O to be
completely asynchronously for testing some upcoming overlapped
I/O related features.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I058c2f324df532f792c96012a3c4351563361716

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448328


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarwuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
parent 30bfdc9c
Loading
Loading
Loading
Loading
+32 −6
Original line number Diff line number Diff line
@@ -221,8 +221,10 @@ init_failure(void)
}

static void
backing_dev_readv(struct spdk_reduce_backing_dev *backing_dev, struct iovec *iov, int iovcnt,
		  uint64_t lba, uint32_t lba_count, struct spdk_reduce_vol_cb_args *args)
backing_dev_readv_execute(struct spdk_reduce_backing_dev *backing_dev,
			  struct iovec *iov, int iovcnt,
			  uint64_t lba, uint32_t lba_count,
			  struct spdk_reduce_vol_cb_args *args)
{
	char *offset;
	int i;
@@ -236,8 +238,17 @@ backing_dev_readv(struct spdk_reduce_backing_dev *backing_dev, struct iovec *iov
}

static void
backing_dev_writev(struct spdk_reduce_backing_dev *backing_dev, struct iovec *iov, int iovcnt,
backing_dev_readv(struct spdk_reduce_backing_dev *backing_dev, struct iovec *iov, int iovcnt,
		  uint64_t lba, uint32_t lba_count, struct spdk_reduce_vol_cb_args *args)
{
	backing_dev_readv_execute(backing_dev, iov, iovcnt, lba, lba_count, args);
}

static void
backing_dev_writev_execute(struct spdk_reduce_backing_dev *backing_dev,
			   struct iovec *iov, int iovcnt,
			   uint64_t lba, uint32_t lba_count,
			   struct spdk_reduce_vol_cb_args *args)
{
	char *offset;
	int i;
@@ -251,8 +262,16 @@ backing_dev_writev(struct spdk_reduce_backing_dev *backing_dev, struct iovec *io
}

static void
backing_dev_unmap(struct spdk_reduce_backing_dev *backing_dev,
backing_dev_writev(struct spdk_reduce_backing_dev *backing_dev, struct iovec *iov, int iovcnt,
		   uint64_t lba, uint32_t lba_count, struct spdk_reduce_vol_cb_args *args)
{
	backing_dev_writev_execute(backing_dev, iov, iovcnt, lba, lba_count, args);
}

static void
backing_dev_unmap_execute(struct spdk_reduce_backing_dev *backing_dev,
			  uint64_t lba, uint32_t lba_count,
			  struct spdk_reduce_vol_cb_args *args)
{
	char *offset;

@@ -261,6 +280,13 @@ backing_dev_unmap(struct spdk_reduce_backing_dev *backing_dev,
	args->cb_fn(args->cb_arg, 0);
}

static void
backing_dev_unmap(struct spdk_reduce_backing_dev *backing_dev,
		  uint64_t lba, uint32_t lba_count, struct spdk_reduce_vol_cb_args *args)
{
	backing_dev_unmap_execute(backing_dev, lba, lba_count, args);
}

static void
backing_dev_destroy(struct spdk_reduce_backing_dev *backing_dev)
{