Commit d3d6f74c authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

bdev/nvme: Inline find_admin_path()



bdev_nvme_find_admin_path() is used only in a place and it's role
is to find a non-failed ctrlr even after multipath is supported.
Inline it into bdev_nvme_admin_passthru() will be better.

Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: If58507c49b43d047e1f3ef25bbdfb571c36a1956
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9194


Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarDong Yi <dongx.yi@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@gmail.com>
Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
parent 2ee6ab36
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -479,14 +479,6 @@ bdev_nvme_find_io_path(struct nvme_bdev_channel *nbdev_ch,
	return true;
}

static inline bool
bdev_nvme_find_admin_path(struct nvme_bdev_channel *nbdev_ch,
			  struct nvme_ctrlr **_nvme_ctrlr)
{
	*_nvme_ctrlr = nbdev_ch->ctrlr_ch->ctrlr;
	return true;
}

static inline void
bdev_nvme_io_complete_nvme_status(struct nvme_bdev_io *bio,
				  const struct spdk_nvme_cpl *cpl)
@@ -3838,9 +3830,7 @@ bdev_nvme_admin_passthru(struct nvme_bdev_channel *nbdev_ch, struct nvme_bdev_io
	struct nvme_ctrlr *nvme_ctrlr;
	uint32_t max_xfer_size;

	if (!bdev_nvme_find_admin_path(nbdev_ch, &nvme_ctrlr)) {
		return -EINVAL;
	}
	nvme_ctrlr = nbdev_ch->ctrlr_ch->ctrlr;

	max_xfer_size = spdk_nvme_ctrlr_get_max_xfer_size(nvme_ctrlr->ctrlr);