From cd6b3a892dda155829683dc79eac21bb99e4e1f5 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 23 Aug 2018 13:59:11 -0700 Subject: [PATCH] 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 Change-Id: Ia949e3fd55b52e5c873bd591e541ecf6c0c086b1 Reviewed-on: https://review.gerrithub.io/423327 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto --- lib/bdev/raid/bdev_raid.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/lib/bdev/raid/bdev_raid.c b/lib/bdev/raid/bdev_raid.c index 2a5e5b37c..36a050ecd 100644 --- a/lib/bdev/raid/bdev_raid.c +++ b/lib/bdev/raid/bdev_raid.c @@ -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) {