mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 11:33:28 +02:00
dm-integrity: always set the io hints
Don't depend on the defaults to be what is desired if the integrity device was set up with 512b sector size. Always set the queue limits to be at least what the device mapper wants. Signed-off-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
This commit is contained in:
parent
6ebf3b6c6f
commit
cbc1532d2b
|
|
@ -4046,19 +4046,14 @@ static void dm_integrity_io_hints(struct dm_target *ti, struct queue_limits *lim
|
|||
{
|
||||
struct dm_integrity_c *ic = ti->private;
|
||||
|
||||
if (ic->sectors_per_block > 1) {
|
||||
limits->logical_block_size =
|
||||
max(limits->logical_block_size,
|
||||
ic->sectors_per_block << SECTOR_SHIFT);
|
||||
limits->physical_block_size =
|
||||
max(limits->physical_block_size,
|
||||
ic->sectors_per_block << SECTOR_SHIFT);
|
||||
limits->io_min =
|
||||
max(limits->io_min,
|
||||
ic->sectors_per_block << SECTOR_SHIFT);
|
||||
limits->dma_alignment = limits->logical_block_size - 1;
|
||||
limits->discard_granularity = ic->sectors_per_block << SECTOR_SHIFT;
|
||||
}
|
||||
limits->logical_block_size = max(limits->logical_block_size,
|
||||
ic->sectors_per_block << SECTOR_SHIFT);
|
||||
limits->physical_block_size = max(limits->physical_block_size,
|
||||
ic->sectors_per_block << SECTOR_SHIFT);
|
||||
limits->io_min = max(limits->io_min,
|
||||
ic->sectors_per_block << SECTOR_SHIFT);
|
||||
limits->dma_alignment = limits->logical_block_size - 1;
|
||||
limits->discard_granularity = ic->sectors_per_block << SECTOR_SHIFT;
|
||||
|
||||
if (!ic->internal_hash) {
|
||||
struct blk_integrity *bi = &limits->integrity;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user