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: Jim Harris <james.r.harris@intel.com>
Change-Id: I058c2f324df532f792c96012a3c4351563361716

Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448328
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: wuzhouhui <wuzhouhui@kingsoft.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Jim Harris 2019-03-18 06:04:56 -07:00
parent 30bfdc9cc9
commit 670db76047

View File

@ -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,
uint64_t lba, uint32_t lba_count, struct spdk_reduce_vol_cb_args *args)
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,
uint64_t lba, uint32_t lba_count, struct spdk_reduce_vol_cb_args *args)
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)
{