summaryrefslogtreecommitdiff
path: root/drivers/nvme/host/nvme.h
diff options
context:
space:
mode:
authorMinwoo Im <minwoo.im.dev@gmail.com>2021-04-07 18:49:29 +0300
committerChristoph Hellwig <hch@lst.de>2021-04-15 09:12:54 +0300
commit3089738868b665ecc25e7f36e004c073883c16a0 (patch)
treefc950d8d4ccc25964201625ab17a2f713740d6fe /drivers/nvme/host/nvme.h
parent95d54bd1a4c1873aa0e2d4c09966f37954c32b80 (diff)
downloadlinux-3089738868b665ecc25e7f36e004c073883c16a0.tar.xz
nvme: add a nvme_ns_head_multipath helper
Move the multipath gendisk out of #ifdef CONFIG_NVME_MULTIPATH and add a new nvme_ns_head_multipath that uses it to check if a ns_head has a multipath device associated with it. Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com> [hch: added the IS_ENABLED, converted a few existing users] Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Javier González <javier.gonz@samsung.com> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r--drivers/nvme/host/nvme.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 815c032a190e..67ff5d41e7d0 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -413,8 +413,8 @@ struct nvme_ns_head {
bool shared;
int instance;
struct nvme_effects_log *effects;
-#ifdef CONFIG_NVME_MULTIPATH
struct gendisk *disk;
+#ifdef CONFIG_NVME_MULTIPATH
struct bio_list requeue_list;
spinlock_t requeue_lock;
struct work_struct requeue_work;
@@ -425,6 +425,11 @@ struct nvme_ns_head {
#endif
};
+static inline bool nvme_ns_head_multipath(struct nvme_ns_head *head)
+{
+ return IS_ENABLED(CONFIG_NVME_MULTIPATH) && head->disk;
+}
+
enum nvme_ns_features {
NVME_NS_EXT_LBAS = 1 << 0, /* support extended LBA format */
NVME_NS_METADATA_SUPPORTED = 1 << 1, /* support getting generated md */