bdev/raid: remove raid_bdev_io_terminate

This has been reduced to just a call to
spdk_bdev_io_complete(), so it is no longer needed.

While here, call spdk_bdev_io_complete() directly
in the strip-crossing error case as well.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ia949e3fd55b52e5c873bd591e541ecf6c0c086b1

Reviewed-on: https://review.gerrithub.io/423327
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Jim Harris 2018-08-23 13:59:11 -07:00
parent 29f0c4c76d
commit cd6b3a892d

View File

@ -363,21 +363,6 @@ get_curr_base_bdev_index(struct raid_bdev *raid_bdev, struct raid_bdev_io *raid_
return (start_strip % raid_bdev->num_base_bdevs);
}
/*
* brief:
* raid_bdev_io_terminate function terminates the execution of the IO.
* params:
* bdev_io - pointer to parent io
* raid_io - pointer to parent io context
* returns:
* none
*/
static void
raid_bdev_io_terminate(struct spdk_bdev_io *bdev_io, struct raid_bdev_io *raid_io)
{
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
}
/*
* brief:
* raid_bdev_io_submit_fail_process function processes the IO which failed to submit.
@ -397,7 +382,7 @@ raid_bdev_io_submit_fail_process(struct raid_bdev *raid_bdev, struct spdk_bdev_i
uint8_t pd_idx;
if (ret != -ENOMEM) {
raid_bdev_io_terminate(bdev_io, raid_io);
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
} else {
/* Queue the IO to bdev layer wait queue */
pd_idx = get_curr_base_bdev_index(raid_bdev, raid_io);
@ -410,7 +395,7 @@ raid_bdev_io_submit_fail_process(struct raid_bdev *raid_bdev, struct spdk_bdev_i
&raid_io->waitq_entry) != 0) {
SPDK_ERRLOG("bdev io waitq error, it should not happen\n");
assert(0);
raid_bdev_io_terminate(bdev_io, raid_io);
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
}
}
}
@ -483,7 +468,7 @@ _raid_bdev_submit_rw_request(struct spdk_io_channel *ch, struct spdk_bdev_io *bd
if (start_strip != end_strip) {
assert(false);
SPDK_ERRLOG("I/O spans strip boundary!\n");
raid_bdev_io_submit_fail_process(raid_bdev, bdev_io, raid_io, -EINVAL);
spdk_bdev_io_complete(bdev_io, SPDK_BDEV_IO_STATUS_FAILED);
}
ret = raid_bdev_submit_children(bdev_io, start_strip, bdev_io->u.bdev.iovs->iov_base);
if (ret != 0) {