Commit 6eb2657a authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Konrad Sztyber
Browse files

bdev/nvme: Inline bdev_nvme_reset_ctrlr() into _bdev_nvme_reset_io()



Furthermore, inline bdev_nvme_reset_ctrlr() into _bdev_nvme_reset_io().

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


Community-CI: Community CI Samsung <spdk.community.ci.samsung@gmail.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Community-CI: Mellanox Build Bot
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 4bb6b093
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -3070,13 +3070,16 @@ _bdev_nvme_reset_io(struct nvme_io_path *io_path, struct nvme_bdev_io *bio)
	struct spdk_bdev_io *bdev_io = spdk_bdev_io_from_ctx(bio);
	struct nvme_bdev *nbdev = (struct nvme_bdev *)bdev_io->bdev->ctxt;
	struct nvme_ctrlr *nvme_ctrlr = io_path->qpair->ctrlr;
	spdk_msg_fn msg_fn;
	struct nvme_ctrlr_channel *ctrlr_ch;
	int rc;

	assert(bio->io_path == NULL);
	bio->io_path = io_path;

	rc = bdev_nvme_reset_ctrlr(nvme_ctrlr);
	pthread_mutex_lock(&nvme_ctrlr->mutex);
	rc = bdev_nvme_reset_ctrlr_unsafe(nvme_ctrlr, &msg_fn);
	pthread_mutex_unlock(&nvme_ctrlr->mutex);

	if (rc == 0) {
		assert(nvme_ctrlr->ctrlr_op_cb_fn == NULL);
@@ -3084,6 +3087,8 @@ _bdev_nvme_reset_io(struct nvme_io_path *io_path, struct nvme_bdev_io *bio)
		nvme_ctrlr->ctrlr_op_cb_fn = bdev_nvme_reset_io_continue;
		nvme_ctrlr->ctrlr_op_cb_arg = bio;

		spdk_thread_send_msg(nvme_ctrlr->thread, msg_fn, nvme_ctrlr);

		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) {