diff options
author | James Smart <jsmart2021@gmail.com> | 2020-05-19 16:05:51 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-05-27 07:12:38 +0200 |
commit | 4d2ce68835649afebbc5e8816b79426fb04c639f (patch) | |
tree | e5efcbe01817c26e23e22699e80787ed21a47aa7 /drivers/nvme/host/nvme.h | |
parent | nvme: introduce NVME_NS_METADATA_SUPPORTED flag (diff) | |
download | linux-4d2ce68835649afebbc5e8816b79426fb04c639f.tar.xz linux-4d2ce68835649afebbc5e8816b79426fb04c639f.zip |
nvme: make nvme_ns_has_pi accessible to transports
Move the nvme_ns_has_pi() inline from core.c to the nvme.h header.
This allows use by the transports.
Signed-off-by: James Smart <jsmart2021@gmail.com>
[maxg: added a comment for nvme_ns_has_pi()]
Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
Reviewed-by: Israel Rukshin <israelr@mellanox.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r-- | drivers/nvme/host/nvme.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index 9ed6a3dac537..c83ff69338d8 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -16,6 +16,7 @@ #include <linux/fault-inject.h> #include <linux/rcupdate.h> #include <linux/wait.h> +#include <linux/t10-pi.h> #include <trace/events/block.h> @@ -399,6 +400,12 @@ struct nvme_ns { }; +/* NVMe ns supports metadata actions by the controller (generate/strip) */ +static inline bool nvme_ns_has_pi(struct nvme_ns *ns) +{ + return ns->pi_type && ns->ms == sizeof(struct t10_pi_tuple); +} + struct nvme_ctrl_ops { const char *name; struct module *module; |