diff options
-rw-r--r-- | drivers/md/dm-table.c | 19 | ||||
-rw-r--r-- | drivers/md/dm.c | 5 | ||||
-rw-r--r-- | drivers/md/dm.h | 1 | ||||
-rw-r--r-- | include/linux/device-mapper.h | 5 |
4 files changed, 30 insertions, 0 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 2ae35b2f80fd..50601ec7017a 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -1618,6 +1618,25 @@ struct mapped_device *dm_table_get_md(struct dm_table *t) | |||
1618 | } | 1618 | } |
1619 | EXPORT_SYMBOL(dm_table_get_md); | 1619 | EXPORT_SYMBOL(dm_table_get_md); |
1620 | 1620 | ||
1621 | void dm_table_run_md_queue_async(struct dm_table *t) | ||
1622 | { | ||
1623 | struct mapped_device *md; | ||
1624 | struct request_queue *queue; | ||
1625 | unsigned long flags; | ||
1626 | |||
1627 | if (!dm_table_request_based(t)) | ||
1628 | return; | ||
1629 | |||
1630 | md = dm_table_get_md(t); | ||
1631 | queue = dm_get_md_queue(md); | ||
1632 | if (queue) { | ||
1633 | spin_lock_irqsave(queue->queue_lock, flags); | ||
1634 | blk_run_queue_async(queue); | ||
1635 | spin_unlock_irqrestore(queue->queue_lock, flags); | ||
1636 | } | ||
1637 | } | ||
1638 | EXPORT_SYMBOL(dm_table_run_md_queue_async); | ||
1639 | |||
1621 | static int device_discard_capable(struct dm_target *ti, struct dm_dev *dev, | 1640 | static int device_discard_capable(struct dm_target *ti, struct dm_dev *dev, |
1622 | sector_t start, sector_t len, void *data) | 1641 | sector_t start, sector_t len, void *data) |
1623 | { | 1642 | { |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 6382213dbd88..455e64916498 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -468,6 +468,11 @@ sector_t dm_get_size(struct mapped_device *md) | |||
468 | return get_capacity(md->disk); | 468 | return get_capacity(md->disk); |
469 | } | 469 | } |
470 | 470 | ||
471 | struct request_queue *dm_get_md_queue(struct mapped_device *md) | ||
472 | { | ||
473 | return md->queue; | ||
474 | } | ||
475 | |||
471 | struct dm_stats *dm_get_stats(struct mapped_device *md) | 476 | struct dm_stats *dm_get_stats(struct mapped_device *md) |
472 | { | 477 | { |
473 | return &md->stats; | 478 | return &md->stats; |
diff --git a/drivers/md/dm.h b/drivers/md/dm.h index 88cc58c5871a..ed76126aac54 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h | |||
@@ -188,6 +188,7 @@ int dm_lock_for_deletion(struct mapped_device *md, bool mark_deferred, bool only | |||
188 | int dm_cancel_deferred_remove(struct mapped_device *md); | 188 | int dm_cancel_deferred_remove(struct mapped_device *md); |
189 | int dm_request_based(struct mapped_device *md); | 189 | int dm_request_based(struct mapped_device *md); |
190 | sector_t dm_get_size(struct mapped_device *md); | 190 | sector_t dm_get_size(struct mapped_device *md); |
191 | struct request_queue *dm_get_md_queue(struct mapped_device *md); | ||
191 | struct dm_stats *dm_get_stats(struct mapped_device *md); | 192 | struct dm_stats *dm_get_stats(struct mapped_device *md); |
192 | 193 | ||
193 | int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action, | 194 | int dm_kobject_uevent(struct mapped_device *md, enum kobject_action action, |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 5eeeab470cfd..63da56ed9796 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -463,6 +463,11 @@ struct mapped_device *dm_table_get_md(struct dm_table *t); | |||
463 | void dm_table_event(struct dm_table *t); | 463 | void dm_table_event(struct dm_table *t); |
464 | 464 | ||
465 | /* | 465 | /* |
466 | * Run the queue for request-based targets. | ||
467 | */ | ||
468 | void dm_table_run_md_queue_async(struct dm_table *t); | ||
469 | |||
470 | /* | ||
466 | * The device must be suspended before calling this method. | 471 | * The device must be suspended before calling this method. |
467 | * Returns the previous table, which the caller must destroy. | 472 | * Returns the previous table, which the caller must destroy. |
468 | */ | 473 | */ |