Commit 85c938e8 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Mike Snitzer

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: default avatarMikulas Patocka <mpatocka@redhat.com>
Tested-by: default avatarMilan Broz <gmazyland@gmail.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent 074c4466
......@@ -1670,8 +1670,12 @@ int dm_calculate_queue_limits(struct dm_table *t,
blk_set_stacking_limits(&ti_limits);
if (!ti->type->iterate_devices)
if (!ti->type->iterate_devices) {
/* Set I/O hints portion of queue limits */
if (ti->type->io_hints)
ti->type->io_hints(ti, &ti_limits);
goto combine_limits;
}
/*
* Combine queue limits of all the devices this target uses.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment