All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>, Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Ira Weiny <ira.weiny@intel.com>
Cc: dm-devel@lists.linux.dev, nvdimm@lists.linux.dev,
	linux-block@vger.kernel.org
Subject: [PATCH 2/3] nvdimm/btt: always set max_integrity_segments
Date: Wed,  6 Mar 2024 07:27:38 -0700	[thread overview]
Message-ID: <20240306142739.237234-3-hch@lst.de> (raw)
In-Reply-To: <20240306142739.237234-1-hch@lst.de>

max_integrity_segments is just a hardware/driver limit and can be safely
set even when integrity data is not supported.  Set it in the initial
queue_limits passed to blk_alloc_disk to simplify the driver.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/nvdimm/btt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
index 8e855b4e3e383a..1e5aedaf8c7bd9 100644
--- a/drivers/nvdimm/btt.c
+++ b/drivers/nvdimm/btt.c
@@ -1500,6 +1500,7 @@ static int btt_blk_init(struct btt *btt)
 	struct queue_limits lim = {
 		.logical_block_size	= btt->sector_size,
 		.max_hw_sectors		= UINT_MAX,
+		.max_integrity_segments	= 1,
 	};
 	int rc;
 
@@ -1521,7 +1522,6 @@ static int btt_blk_init(struct btt *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);
-- 
2.39.2


  parent reply	other threads:[~2024-03-06 14:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 14:27 remove calls to blk_queue_max_integrity_segments Christoph Hellwig
2024-03-06 14:27 ` [PATCH 1/3] nvdimm: remove nd_integrity_init Christoph Hellwig
2024-03-06 14:27 ` Christoph Hellwig [this message]
2024-03-06 14:27 ` [PATCH 3/3] dm-integrity: set max_integrity_segments in dm_integrity_io_hints Christoph Hellwig
2024-03-06 17:25   ` Mike Snitzer
2024-03-06 21:57     ` 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=20240306142739.237234-3-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=ira.weiny@intel.com \
    --cc=linux-block@vger.kernel.org \
    --cc=mpatocka@redhat.com \
    --cc=nvdimm@lists.linux.dev \
    --cc=snitzer@kernel.org \
    --cc=vishal.l.verma@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.