diff --git a/module/bdev/nvme/bdev_nvme.c b/module/bdev/nvme/bdev_nvme.c index e95103b61..339e14263 100644 --- a/module/bdev/nvme/bdev_nvme.c +++ b/module/bdev/nvme/bdev_nvme.c @@ -825,15 +825,11 @@ nvme_ctrlr_is_available(struct nvme_ctrlr *nvme_ctrlr) return true; } -static inline struct nvme_io_path * -bdev_nvme_find_io_path(struct nvme_bdev_channel *nbdev_ch) +static struct nvme_io_path * +_bdev_nvme_find_io_path(struct nvme_bdev_channel *nbdev_ch) { struct nvme_io_path *io_path, *non_optimized = NULL; - if (spdk_likely(nbdev_ch->current_io_path != NULL)) { - return nbdev_ch->current_io_path; - } - STAILQ_FOREACH(io_path, &nbdev_ch->io_path_list, stailq) { if (spdk_unlikely(!nvme_io_path_is_connected(io_path))) { /* The device is currently resetting. */ @@ -861,6 +857,16 @@ bdev_nvme_find_io_path(struct nvme_bdev_channel *nbdev_ch) return non_optimized; } +static inline struct nvme_io_path * +bdev_nvme_find_io_path(struct nvme_bdev_channel *nbdev_ch) +{ + if (spdk_unlikely(nbdev_ch->current_io_path == NULL)) { + return _bdev_nvme_find_io_path(nbdev_ch); + } + + return nbdev_ch->current_io_path; +} + /* Return true if there is any io_path whose qpair is active or ctrlr is not failed, * or false otherwise. *