linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 3/6] nvme: don't pass struct nvme_ns to nvme_init_integrity
Date: Thu,  2 Nov 2017 21:28:53 +0300	[thread overview]
Message-ID: <20171102182856.9162-4-hch@lst.de> (raw)
In-Reply-To: <20171102182856.9162-1-hch@lst.de>

To allow reusing this function for the multipath node.

Signed-off-by: Christoph Hellwig <hch at lst.de>
---
 drivers/nvme/host/core.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index bc27f6603861..8702e49c5c45 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1081,12 +1081,12 @@ static int nvme_getgeo(struct block_device *bdev, struct hd_geometry *geo)
 }
 
 #ifdef CONFIG_BLK_DEV_INTEGRITY
-static void nvme_init_integrity(struct nvme_ns *ns)
+static void nvme_init_integrity(struct gendisk *disk, u16 ms, u8 pi_type)
 {
 	struct blk_integrity integrity;
 
 	memset(&integrity, 0, sizeof(integrity));
-	switch (ns->pi_type) {
+	switch (pi_type) {
 	case NVME_NS_DPS_PI_TYPE3:
 		integrity.profile = &t10_pi_type3_crc;
 		integrity.tag_size = sizeof(u16) + sizeof(u32);
@@ -1102,12 +1102,12 @@ static void nvme_init_integrity(struct nvme_ns *ns)
 		integrity.profile = NULL;
 		break;
 	}
-	integrity.tuple_size = ns->ms;
-	blk_integrity_register(ns->disk, &integrity);
-	blk_queue_max_integrity_segments(ns->queue, 1);
+	integrity.tuple_size = ms;
+	blk_integrity_register(disk, &integrity);
+	blk_queue_max_integrity_segments(disk->queue, 1);
 }
 #else
-static void nvme_init_integrity(struct nvme_ns *ns)
+static void nvme_init_integrity(struct gendisk *disk, u16 ms, u8 pi_type)
 {
 }
 #endif /* CONFIG_BLK_DEV_INTEGRITY */
@@ -1191,7 +1191,7 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
 		nvme_set_chunk_size(ns);
 	if (ns->ms && !ns->ext &&
 	    (ctrl->ops->flags & NVME_F_METADATA_SUPPORTED))
-		nvme_init_integrity(ns);
+		nvme_init_integrity(disk, ns->ms, ns->pi_type);
 	if (ns->ms && !(ns->ms == 8 && ns->pi_type) && !blk_get_integrity(disk))
 		set_capacity(disk, 0);
 	else
-- 
2.14.2

  parent reply	other threads:[~2017-11-02 18:28 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-02 18:28 nvme cleanups in preparation for the multipath code Christoph Hellwig
2017-11-02 18:28 ` [PATCH 1/6] nvme: move the dying queue check from cancel to completion Christoph Hellwig
2017-11-05 14:01   ` Sagi Grimberg
2017-11-06 14:46   ` Keith Busch
2017-11-02 18:28 ` [PATCH 2/6] nvme: always unregister the integrity profile in __nvme_revalidate_disk Christoph Hellwig
2017-11-05 14:02   ` Sagi Grimberg
2017-11-06 14:46   ` Keith Busch
2017-11-02 18:28 ` Christoph Hellwig [this message]
2017-11-05 14:03   ` [PATCH 3/6] nvme: don't pass struct nvme_ns to nvme_init_integrity Sagi Grimberg
2017-11-06 14:47   ` Keith Busch
2017-11-02 18:28 ` [PATCH 4/6] nvme: don't pass struct nvme_ns to nvme_config_discard Christoph Hellwig
2017-11-06 14:47   ` Keith Busch
2017-11-02 18:28 ` [PATCH 5/6] nvme: set the chunk size before freezing the queue Christoph Hellwig
2017-11-06 14:48   ` Keith Busch
2017-11-02 18:28 ` [PATCH 6/6] nvme: split __nvme_revalidate_disk Christoph Hellwig
2017-11-05 14:05   ` Sagi Grimberg
2017-11-06 14:49   ` Keith Busch

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=20171102182856.9162-4-hch@lst.de \
    --to=hch@lst.de \
    /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;
as well as URLs for NNTP newsgroup(s).