Commit 39b7baa4 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

nvme: don't pass struct nvme_ns to nvme_init_integrity

To allow reusing this function for the multipath node.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarKeith Busch <keith.busch@intel.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b5be3b39
...@@ -1081,12 +1081,12 @@ static int nvme_getgeo(struct block_device *bdev, struct hd_geometry *geo) ...@@ -1081,12 +1081,12 @@ static int nvme_getgeo(struct block_device *bdev, struct hd_geometry *geo)
} }
#ifdef CONFIG_BLK_DEV_INTEGRITY #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; struct blk_integrity integrity;
memset(&integrity, 0, sizeof(integrity)); memset(&integrity, 0, sizeof(integrity));
switch (ns->pi_type) { switch (pi_type) {
case NVME_NS_DPS_PI_TYPE3: case NVME_NS_DPS_PI_TYPE3:
integrity.profile = &t10_pi_type3_crc; integrity.profile = &t10_pi_type3_crc;
integrity.tag_size = sizeof(u16) + sizeof(u32); integrity.tag_size = sizeof(u16) + sizeof(u32);
...@@ -1102,12 +1102,12 @@ static void nvme_init_integrity(struct nvme_ns *ns) ...@@ -1102,12 +1102,12 @@ static void nvme_init_integrity(struct nvme_ns *ns)
integrity.profile = NULL; integrity.profile = NULL;
break; break;
} }
integrity.tuple_size = ns->ms; integrity.tuple_size = ms;
blk_integrity_register(ns->disk, &integrity); blk_integrity_register(disk, &integrity);
blk_queue_max_integrity_segments(ns->queue, 1); blk_queue_max_integrity_segments(disk->queue, 1);
} }
#else #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 */ #endif /* CONFIG_BLK_DEV_INTEGRITY */
...@@ -1191,7 +1191,7 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id) ...@@ -1191,7 +1191,7 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
nvme_set_chunk_size(ns); nvme_set_chunk_size(ns);
if (ns->ms && !ns->ext && if (ns->ms && !ns->ext &&
(ctrl->ops->flags & NVME_F_METADATA_SUPPORTED)) (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)) if (ns->ms && !(ns->ms == 8 && ns->pi_type) && !blk_get_integrity(disk))
set_capacity(disk, 0); set_capacity(disk, 0);
else else
......
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