diff mbox series

[2/4] dm: Process .io_hints for drivers not having underlying devices

Message ID 164846630905.251310.11706161266244591219.stgit@pro (mailing list archive)
State New, archived
Headers show
Series dm: Introduce dm-qcow2 driver to attach QCOW2 files as block device | expand

Commit Message

Kirill Tkhai March 28, 2022, 11:18 a.m. UTC
This makes dm_calculate_queue_limits() sets the hints also for drivers,
which do not have underlying devices.
This is useful for dm-qcow2 driver, that wants to have incomming requests
are likely splitted by QCOW2 cluster size alignment.

Signed-off-by: Kirill Tkhai <kirill.tkhai@openvz.org>
---
 drivers/md/dm-table.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)



--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
diff mbox series

Patch

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index e43096cfe9e2..aa2e85bef6e7 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1660,8 +1660,11 @@  int dm_calculate_queue_limits(struct dm_table *table,
 
 		ti = dm_table_get_target(table, i);
 
-		if (!ti->type->iterate_devices)
+		if (!ti->type->iterate_devices) {
+			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.