From: sagi@grimberg.me (Sagi Grimberg)
Subject: [PATCH] nvme: move protection information check into nvme_setup_rw
Date: Thu, 15 Jun 2017 12:21:45 +0300 [thread overview]
Message-ID: <d64302e7-6fae-3171-5634-59da3c964bee@grimberg.me> (raw)
In-Reply-To: <20170612163632.23009-1-hch@lst.de>
On 12/06/17 19:36, Christoph Hellwig wrote:
> It only applies to read/write commands, and this way non-PCIe drivers
> get the check as well instead of having to duplicate it when adding
> metadata support.
>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> ---
> drivers/nvme/host/core.c | 16 +++++++++++++---
> drivers/nvme/host/pci.c | 13 +------------
> 2 files changed, 14 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 1a8b0bd77673..c24267a95e66 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -347,12 +347,21 @@ static blk_status_t nvme_setup_discard(struct nvme_ns *ns, struct request *req,
> return BLK_STS_OK;
> }
>
> -static inline void nvme_setup_rw(struct nvme_ns *ns, struct request *req,
> - struct nvme_command *cmnd)
> +static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns,
> + struct request *req, struct nvme_command *cmnd)
> {
> u16 control = 0;
> u32 dsmgmt = 0;
>
> + /*
> + * If formated with metadata, require the block layer provide a buffer
> + * unless this namespace is formated such that the metadata can be
> + * stripped/generated by the controller with PRACT=1.
> + */
> + if (ns && ns->ms && (!ns->pi_type || ns->ms != 8) &&
Not directly related to this patch, but 8 should be replaced with
sizeof(struct t10_pi_tuple).
Otherwise looks good,
Reviewed-by: Sagi Grimberg <sagi at grimberg.me>
Should I send out an incremental change?
next prev parent reply other threads:[~2017-06-15 9:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-12 16:36 [PATCH] nvme: move protection information check into nvme_setup_rw Christoph Hellwig
2017-06-13 8:00 ` Johannes Thumshirn
2017-06-13 8:03 ` Christoph Hellwig
2017-06-13 14:55 ` Keith Busch
2017-06-15 9:21 ` Sagi Grimberg [this message]
2017-06-15 12:11 ` Christoph Hellwig
2017-06-15 12:17 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d64302e7-6fae-3171-5634-59da3c964bee@grimberg.me \
--to=sagi@grimberg.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox