summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/nvme.h
diff options
context:
space:
mode:
authorChristoph Hellwig2017-05-20 15:14:45 +0200
committerChristoph Hellwig2017-05-26 08:54:23 +0200
commitc81bfba9983fc44210d3eb5971e0faac597bf50d (patch)
tree0b9009c4b6f35a08c1d3fc93082989901de01739 /drivers/nvme/host/nvme.h
parentnvme: replace is_flags field in nvme_ctrl_ops with a flags field (diff)
downloadkernel-qcow2-linux-c81bfba9983fc44210d3eb5971e0faac597bf50d.tar.gz
kernel-qcow2-linux-c81bfba9983fc44210d3eb5971e0faac597bf50d.tar.xz
kernel-qcow2-linux-c81bfba9983fc44210d3eb5971e0faac597bf50d.zip
nvme: only setup block integrity if supported by the driver
Currently only the PCIe driver supports metadata, so we should not claim integrity support for the other drivers. This prevents nasty crashes with targets that advertise metadata support on fabrics. Also use the opportunity to factor out some code into a separate helper that isn't even compiled if CONFIG_BLK_DEV_INTEGRITY is disabled. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Keith Busch <keith.busch@intel.com>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r--drivers/nvme/host/nvme.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 7c4b0f6636c5..9d6a070d4391 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -210,6 +210,7 @@ struct nvme_ctrl_ops {
struct module *module;
unsigned int flags;
#define NVME_F_FABRICS (1 << 0)
+#define NVME_F_METADATA_SUPPORTED (1 << 1)
int (*reg_read32)(struct nvme_ctrl *ctrl, u32 off, u32 *val);
int (*reg_write32)(struct nvme_ctrl *ctrl, u32 off, u32 val);
int (*reg_read64)(struct nvme_ctrl *ctrl, u32 off, u64 *val);