Skip to content

Commit

Permalink
dm table: allow targets without devices to set ->io_hints
Browse files Browse the repository at this point in the history
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 <[email protected]>
Tested-by: Milan Broz <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
  • Loading branch information
Mikulas Patocka authored and Mike Snitzer committed Apr 4, 2023
1 parent 074c446 commit 85c938e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/md/dm-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 85c938e

Please sign in to comment.