diff options
author | Mike Snitzer <snitzer@redhat.com> | 2014-02-28 09:33:43 -0500 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2014-03-27 16:56:24 -0400 |
commit | 9974fa2c6a7d470ca3c201fe7dbac64bf4dd8d2a (patch) | |
tree | 623ceaee0342585c95c0eca67ab3e6c4f03bb9e2 /drivers/md/dm-table.c | |
parent | 17f4ff45b58742e2cb32fce6e406dbdb4b32a1e7 (diff) |
dm table: add dm_table_run_md_queue_async
Introduce dm_table_run_md_queue_async() to run the request_queue of the
mapped_device associated with a request-based DM table.
Also add dm_md_get_queue() wrapper to extract the request_queue from a
mapped_device.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 19 |
1 files changed, 19 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 | { |