summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2023-04-04 18:14:26 +0300
committerMike Snitzer <snitzer@kernel.org>2023-04-04 20:30:17 +0300
commit85c938e8914f8f0e276b8e82d4f2e4bcab044e96 (patch)
treeb136252fc9a78356eb548cdb402e947d1591964d /drivers
parent074c44664f60f62ef932eae9ee89d663563cf307 (diff)
downloadlinux-85c938e8914f8f0e276b8e82d4f2e4bcab044e96.tar.xz
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/md/dm-table.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 2055a758541d..119db5e01080 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -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.