Commit 4d2ce688 authored by James Smart's avatar James Smart Committed by Christoph Hellwig

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: default avatarJames Smart <jsmart2021@gmail.com>
[maxg: added a comment for nvme_ns_has_pi()]
Signed-off-by: default avatarMax Gurtovoy <maxg@mellanox.com>
Reviewed-by: default avatarIsrael Rukshin <israelr@mellanox.com>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent b29f8485
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <linux/pr.h> #include <linux/pr.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/nvme_ioctl.h> #include <linux/nvme_ioctl.h>
#include <linux/t10-pi.h>
#include <linux/pm_qos.h> #include <linux/pm_qos.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
...@@ -204,11 +203,6 @@ static void nvme_delete_ctrl_sync(struct nvme_ctrl *ctrl) ...@@ -204,11 +203,6 @@ static void nvme_delete_ctrl_sync(struct nvme_ctrl *ctrl)
nvme_put_ctrl(ctrl); nvme_put_ctrl(ctrl);
} }
static inline bool nvme_ns_has_pi(struct nvme_ns *ns)
{
return ns->pi_type && ns->ms == sizeof(struct t10_pi_tuple);
}
static blk_status_t nvme_error_status(u16 status) static blk_status_t nvme_error_status(u16 status)
{ {
switch (status & 0x7ff) { switch (status & 0x7ff) {
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/fault-inject.h> #include <linux/fault-inject.h>
#include <linux/rcupdate.h> #include <linux/rcupdate.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/t10-pi.h>
#include <trace/events/block.h> #include <trace/events/block.h>
...@@ -399,6 +400,12 @@ struct nvme_ns { ...@@ -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 { struct nvme_ctrl_ops {
const char *name; const char *name;
struct module *module; struct module *module;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment