Skip to content

Commit 85c938e

Browse files
Mikulas PatockaMike Snitzer
authored andcommitted
dm table: allow targets without devices to set ->io_hints
In dm_calculate_queue_limits, add call to ->io_hints hook if the target doesn't provide ->iterate_devices. This is needed so the "error" and "zero" targets may support discards. The 2 following commits will add their respective discard support. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Tested-by: Milan Broz <gmazyland@gmail.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
1 parent 074c446 commit 85c938e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/md/dm-table.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,8 +1670,12 @@ int dm_calculate_queue_limits(struct dm_table *t,
16701670

16711671
blk_set_stacking_limits(&ti_limits);
16721672

1673-
if (!ti->type->iterate_devices)
1673+
if (!ti->type->iterate_devices) {
1674+
/* Set I/O hints portion of queue limits */
1675+
if (ti->type->io_hints)
1676+
ti->type->io_hints(ti, &ti_limits);
16741677
goto combine_limits;
1678+
}
16751679

16761680
/*
16771681
* Combine queue limits of all the devices this target uses.

0 commit comments

Comments
 (0)