From: Hannes Reinecke <hare@suse.de>
To: Alasdair Kergon <agk@redhat.com>
Cc: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>,
dm-devel@redhat.com, Mike Snitzer <snitzer@redhat.com>
Subject: [PATCH 2/7] dm table: add dm_table_run_md_queue_async
Date: Tue, 4 Feb 2014 11:54:35 +0100 [thread overview]
Message-ID: <1391511280-29325-3-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1391511280-29325-1-git-send-email-hare@suse.de>
From: Mike Snitzer <snitzer@redhat.com>
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>
---
drivers/md/dm-table.c | 19 +++++++++++++++++++
drivers/md/dm.c | 5 +++++
drivers/md/dm.h | 1 +
include/linux/device-mapper.h | 5 +++++
4 files changed, 30 insertions(+)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 6a7f2b8..8df63ed 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)
}
EXPORT_SYMBOL(dm_table_get_md);
+void dm_table_run_md_queue_async(struct dm_table *t)
+{
+ struct mapped_device *md;
+ struct request_queue *queue;
+ unsigned long flags;
+
+ if (!dm_table_request_based(t))
+ return;
+
+ md = dm_table_get_md(t);
+ queue = dm_get_md_queue(md);
+ if (queue) {
+ spin_lock_irqsave(queue->queue_lock, flags);
+ blk_run_queue_async(queue);
+ spin_unlock_irqrestore(queue->queue_lock, flags);
+ }
+}
+EXPORT_SYMBOL(dm_table_run_md_queue_async);
+
static int device_discard_capable(struct dm_target *ti, struct dm_dev *dev,
sector_t start, sector_t len, void *data)
{
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 8c53b09..341991f 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -475,6 +475,11 @@ sector_t dm_get_size(struct mapped_device *md)
return get_capacity(md->disk);
}
+struct request_queue *dm_get_md_queue(struct mapped_device *md)
+{
+ return md->queue;
+}
+
struct dm_stats *dm_get_stats(struct mapped_device *md)
{
return &md->stats;
diff --git a/drivers/md/dm.h b/drivers/md/dm.h
index c4569f0..1b2ca8a 100644
--- a/drivers/md/dm.h
+++ b/drivers/md/dm.h
@@ -189,6 +189,7 @@ int dm_lock_for_deletion(struct mapped_device *md, bool mark_deferred, bool only
int dm_cancel_deferred_remove(struct mapped_device *md);
int dm_request_based(struct mapped_device *md);
sector_t dm_get_size(struct mapped_device *md);
+struct request_queue *dm_get_md_queue(struct mapped_device *md);
struct dm_stats *dm_get_stats(struct mapped_device *md);
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 ed419c6..250225b 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -466,6 +466,11 @@ struct mapped_device *dm_table_get_md(struct dm_table *t);
void dm_table_event(struct dm_table *t);
/*
+ * Run the queue for request-based targets.
+ */
+void dm_table_run_md_queue_async(struct dm_table *t);
+
+/*
* The device must be suspended before calling this method.
* Returns the previous table, which the caller must destroy.
*/
--
1.7.12.4
next prev parent reply other threads:[~2014-02-04 10:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 10:54 [PATCHv7 0/7] dm-multipath: push back requests instead of queueing Hannes Reinecke
2014-02-04 10:54 ` [PATCH 1/7] dm mpath: do not call pg_init when it is already running Hannes Reinecke
2014-02-04 10:54 ` Hannes Reinecke [this message]
2014-02-04 10:54 ` [PATCH 3/7] dm mpath: push back requests instead of queueing Hannes Reinecke
2014-02-04 10:54 ` [PATCH 4/7] dm mpath: remove process_queued_ios() Hannes Reinecke
2014-02-04 11:26 ` Junichi Nomura
2014-02-04 11:31 ` Hannes Reinecke
2014-02-10 13:30 ` Mike Snitzer
2014-02-11 9:46 ` Hannes Reinecke
2014-02-11 15:55 ` Mike Snitzer
2014-02-11 18:03 ` Hannes Reinecke
2014-02-11 16:29 ` Mike Snitzer
2014-02-12 2:37 ` Junichi Nomura
2014-02-04 10:54 ` [PATCH 5/7] dm mpath: reduce memory pressure when requeuing Hannes Reinecke
2014-02-04 10:54 ` [PATCH 6/7] dm mpath: remove map_io() Hannes Reinecke
2014-02-04 10:54 ` [PATCH 7/7] dm mpath: remove extra nesting in map function Hannes Reinecke
-- strict thread matches above, loose matches on Subject: below --
2014-02-03 20:28 [PATCH v6 0/7] dm-multipath: push back requests instead of queueing Mike Snitzer
2014-02-03 20:28 ` [PATCH 2/7] dm table: add dm_table_run_md_queue_async Mike Snitzer
2014-02-04 3:27 ` Junichi Nomura
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1391511280-29325-3-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=j-nomura@ce.jp.nec.com \
--cc=snitzer@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.