bdev/nvme: Remove unnecessary error check from bdev_nvme_reset_ctrlr()

spdk_for_each_channel() always passes status=0 to its completion callback
if each channel completes the requested function successfully.

bdev_nvme_reset_destroy_qpair() always succeeds.

Hence bdev_nvme_reset_ctrlr() does not have to check if the passed
status is not zero.

The following patches will aggregate multiple flags into a single
state for nvme_ctrlr. This change will simplify these.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I1c30c9b20c96886516029e69e90dc23d777a69b4
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10077
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Shuhei Matsumoto 2021-10-31 20:28:00 +09:00 committed by Tomasz Zawadzki
parent f9fba507fe
commit 1d524bc384

View File

@ -1313,23 +1313,18 @@ bdev_nvme_reset_ctrlr(struct spdk_io_channel_iter *i, int status)
struct nvme_ctrlr *nvme_ctrlr = spdk_io_channel_iter_get_io_device(i);
int rc;
if (status) {
goto err;
}
assert(status == 0);
rc = spdk_nvme_ctrlr_reset_async(nvme_ctrlr->ctrlr, &nvme_ctrlr->reset_ctx);
if (rc != 0) {
SPDK_ERRLOG("Create controller reset context failed\n");
goto err;
bdev_nvme_reset_complete(nvme_ctrlr, false);
return;
}
assert(nvme_ctrlr->reset_detach_poller == NULL);
nvme_ctrlr->reset_detach_poller = SPDK_POLLER_REGISTER(bdev_nvme_ctrlr_reset_poll,
nvme_ctrlr, 0);
return;
err:
bdev_nvme_reset_complete(nvme_ctrlr, false);
}
static void
@ -1339,6 +1334,7 @@ bdev_nvme_reset_destroy_qpair(struct spdk_io_channel_iter *i)
struct nvme_ctrlr_channel *ctrlr_ch = spdk_io_channel_get_ctx(ch);
bdev_nvme_destroy_qpair(ctrlr_ch);
spdk_for_each_channel_continue(i, 0);
}