]> www.infradead.org Git - users/hch/block.git/commitdiff
nvme: move blk_integrity_unregister into nvme_init_integrity
authorChristoph Hellwig <hch@lst.de>
Mon, 26 Feb 2024 15:37:26 +0000 (10:37 -0500)
committerChristoph Hellwig <hch@lst.de>
Thu, 29 Feb 2024 15:01:30 +0000 (07:01 -0800)
Move uneregistering the existing integrity profile into the helper
dealing with all the other integrity / metadata setup.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
drivers/nvme/host/core.c

index 76e548902ec33e39b21fa9a205b071ffb9075ec4..105046a79572725fb3ee4c4c70ebe2a56e8f622b 100644 (file)
@@ -1727,6 +1727,8 @@ static bool nvme_init_integrity(struct gendisk *disk, struct nvme_ns_head *head)
 {
        struct blk_integrity integrity = { };
 
+       blk_integrity_unregister(disk);
+
        if (!head->ms)
                return true;
 
@@ -1980,8 +1982,6 @@ static void nvme_update_disk_info(struct nvme_ctrl *ctrl, struct gendisk *disk,
                bs = (1 << 9);
        }
 
-       blk_integrity_unregister(disk);
-
        atomic_bs = phys_bs = bs;
        if (id->nabo == 0) {
                /*