[PATCH 07/19] nvme-multipath: add nvme_mpath_is_{disabled, optimised}

From: John Garry

Date: Wed Feb 25 2026 - 10:50:58 EST


These are for mpath_head_template.is_{disabled, optimized} callbacks, and
just call into nvme_path_is_disabled() and nvme_path_is_optimized(),
respectively.

Signed-off-by: John Garry <john.g.garry@xxxxxxxxxx>
---
drivers/nvme/host/multipath.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index c90ac76dbe317..07461a7d8d1fa 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -310,6 +310,13 @@ static bool nvme_path_is_disabled(struct nvme_ns *ns)
return false;
}

+static bool nvme_mpath_is_disabled(struct mpath_device *mpath_device)
+{
+ struct nvme_ns *ns = nvme_mpath_to_ns(mpath_device);
+
+ return nvme_path_is_disabled(ns);
+}
+
static struct nvme_ns *__nvme_find_path(struct nvme_ns_head *head, int node)
{
int found_distance = INT_MAX, fallback_distance = INT_MAX, distance;
@@ -452,6 +459,13 @@ static inline bool nvme_path_is_optimized(struct nvme_ns *ns)
ns->ana_state == NVME_ANA_OPTIMIZED;
}

+static bool nvme_mpath_is_optimized(struct mpath_device *mpath_device)
+{
+ struct nvme_ns *ns = nvme_mpath_to_ns(mpath_device);
+
+ return nvme_path_is_optimized(ns);
+}
+
static struct nvme_ns *nvme_numa_path(struct nvme_ns_head *head)
{
int node = numa_node_id();
@@ -1455,4 +1469,6 @@ static const struct mpath_head_template mpdt = {
.available_path = nvme_mpath_available_path,
.add_cdev = nvme_mpath_add_cdev,
.del_cdev = nvme_mpath_del_cdev,
+ .is_disabled = nvme_mpath_is_disabled,
+ .is_optimized = nvme_mpath_is_optimized,
};
--
2.43.5