diff options
author | Christoph Hellwig <hch@lst.de> | 2024-03-06 07:27:37 -0700 |
---|---|---|
committer | Ira Weiny <ira.weiny@intel.com> | 2024-04-25 12:37:12 -0700 |
commit | 9566b89295196996bce57bf307bc634cb0713cec (patch) | |
tree | 7d76ee996c652e8cc48347508a9874e82ed172a3 /drivers/nvdimm/btt.c | |
parent | 2c720b492c59b070930aa1be8bef6e256d3bf4b2 (diff) |
nvdimm: remove nd_integrity_init
nd_integrity_init is only called from a single place. Open code it
there, and use IS_ENABLED to remove the need for an extra stub.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240306142739.237234-2-hch@lst.de
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Diffstat (limited to 'drivers/nvdimm/btt.c')
-rw-r--r-- | drivers/nvdimm/btt.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index 4d0c527e8576..8e855b4e3e38 100644 --- a/drivers/nvdimm/btt.c +++ b/drivers/nvdimm/btt.c @@ -6,6 +6,7 @@ #include <linux/highmem.h> #include <linux/debugfs.h> #include <linux/blkdev.h> +#include <linux/blk-integrity.h> #include <linux/pagemap.h> #include <linux/module.h> #include <linux/device.h> @@ -1514,10 +1515,13 @@ static int btt_blk_init(struct btt *btt) blk_queue_flag_set(QUEUE_FLAG_NONROT, btt->btt_disk->queue); blk_queue_flag_set(QUEUE_FLAG_SYNCHRONOUS, btt->btt_disk->queue); - if (btt_meta_size(btt)) { - rc = nd_integrity_init(btt->btt_disk, btt_meta_size(btt)); - if (rc) - goto out_cleanup_disk; + if (btt_meta_size(btt) && IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY)) { + struct blk_integrity bi = { + .tuple_size = btt_meta_size(btt), + .tag_size = btt_meta_size(btt), + }; + blk_integrity_register(btt->btt_disk, &bi); + blk_queue_max_integrity_segments(btt->btt_disk->queue, 1); } set_capacity(btt->btt_disk, btt->nlba * btt->sector_size >> 9); |