diff options
-rw-r--r-- | drivers/md/dm-table.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 14954d844668..6554d9148927 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -1389,6 +1389,14 @@ static int queue_supports_sg_merge(struct dm_target *ti, struct dm_dev *dev, | |||
1389 | return q && !test_bit(QUEUE_FLAG_NO_SG_MERGE, &q->queue_flags); | 1389 | return q && !test_bit(QUEUE_FLAG_NO_SG_MERGE, &q->queue_flags); |
1390 | } | 1390 | } |
1391 | 1391 | ||
1392 | static int queue_supports_sg_gaps(struct dm_target *ti, struct dm_dev *dev, | ||
1393 | sector_t start, sector_t len, void *data) | ||
1394 | { | ||
1395 | struct request_queue *q = bdev_get_queue(dev->bdev); | ||
1396 | |||
1397 | return q && !test_bit(QUEUE_FLAG_SG_GAPS, &q->queue_flags); | ||
1398 | } | ||
1399 | |||
1392 | static bool dm_table_all_devices_attribute(struct dm_table *t, | 1400 | static bool dm_table_all_devices_attribute(struct dm_table *t, |
1393 | iterate_devices_callout_fn func) | 1401 | iterate_devices_callout_fn func) |
1394 | { | 1402 | { |
@@ -1509,6 +1517,11 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, | |||
1509 | else | 1517 | else |
1510 | queue_flag_set_unlocked(QUEUE_FLAG_NO_SG_MERGE, q); | 1518 | queue_flag_set_unlocked(QUEUE_FLAG_NO_SG_MERGE, q); |
1511 | 1519 | ||
1520 | if (dm_table_all_devices_attribute(t, queue_supports_sg_gaps)) | ||
1521 | queue_flag_clear_unlocked(QUEUE_FLAG_SG_GAPS, q); | ||
1522 | else | ||
1523 | queue_flag_set_unlocked(QUEUE_FLAG_SG_GAPS, q); | ||
1524 | |||
1512 | dm_table_set_integrity(t); | 1525 | dm_table_set_integrity(t); |
1513 | 1526 | ||
1514 | /* | 1527 | /* |