Skip to content

Commit 1e97469

Browse files
Christoph Hellwigweiny2
authored andcommitted
nvdimm/btt: always set max_integrity_segments
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ira Weiny <[email protected]>
1 parent 9566b89 commit 1e97469

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvdimm/btt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,7 @@ static int btt_blk_init(struct btt *btt)
15001500
struct queue_limits lim = {
15011501
.logical_block_size = btt->sector_size,
15021502
.max_hw_sectors = UINT_MAX,
1503+
.max_integrity_segments = 1,
15031504
};
15041505
int rc;
15051506

@@ -1521,7 +1522,6 @@ static int btt_blk_init(struct btt *btt)
15211522
.tag_size = btt_meta_size(btt),
15221523
};
15231524
blk_integrity_register(btt->btt_disk, &bi);
1524-
blk_queue_max_integrity_segments(btt->btt_disk->queue, 1);
15251525
}
15261526

15271527
set_capacity(btt->btt_disk, btt->nlba * btt->sector_size >> 9);

0 commit comments

Comments
 (0)