Commit 4bb6b093 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Konrad Sztyber
Browse files

bdev/nvme: Inline nvme_ctrlr_op(CTRLR_OP_RESET) into _bdev_nvme_reset_io()



Inline nvme_ctrlr_op(CTRLR_OP_RESET) into _bdev_nvme_reset_io().
Simplify if-else block a little together.

Signed-off-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Change-Id: I98359cc0ce9d124159ee43bff9cd91f0c9a2cd1d
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/25289


Community-CI: Mellanox Build Bot
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com>
parent 517e85fc
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -3076,10 +3076,14 @@ _bdev_nvme_reset_io(struct nvme_io_path *io_path, struct nvme_bdev_io *bio)
	assert(bio->io_path == NULL);
	bio->io_path = io_path;

	rc = nvme_ctrlr_op(nvme_ctrlr, NVME_CTRLR_OP_RESET,
			   bdev_nvme_reset_io_continue, bio);
	rc = bdev_nvme_reset_ctrlr(nvme_ctrlr);

	if (rc == 0) {
		assert(nvme_ctrlr->ctrlr_op_cb_fn == NULL);
		assert(nvme_ctrlr->ctrlr_op_cb_arg == NULL);
		nvme_ctrlr->ctrlr_op_cb_fn = bdev_nvme_reset_io_continue;
		nvme_ctrlr->ctrlr_op_cb_arg = bio;

		NVME_BDEV_INFOLOG(nbdev, "reset_io %p started resetting ctrlr [%s, %u].\n",
				  bio, CTRLR_STRING(nvme_ctrlr), CTRLR_ID(nvme_ctrlr));
	} else if (rc == -EBUSY) {