From: NeilBrown <nfbrown@novell.com>
To: Heinz Mauelshagen <heinzm@redhat.com>,
Alasdair G Kergon <agk@redhat.com>
Cc: linux-raid@vger.kernel.org, dm-devel@redhat.com
Subject: [PATCH 3/8] dm-raid456: support unplug
Date: Mon, 26 Jul 2010 13:24:35 +1000 [thread overview]
Message-ID: <20100726032435.29687.63743.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100726032230.29687.5366.stgit@localhost.localdomain>
In a similar manner to congestion checking, per-target
unplug support for raid456 under dm.
Signed-off-by: NeilBrown <neilb@suse.de>
---
drivers/md/dm-raid456.c | 9 +++++++++
drivers/md/dm-table.c | 4 ++++
include/linux/device-mapper.h | 1 +
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/md/dm-raid456.c b/drivers/md/dm-raid456.c
index 0e3922a..47db9d4 100644
--- a/drivers/md/dm-raid456.c
+++ b/drivers/md/dm-raid456.c
@@ -154,6 +154,14 @@ static int raid_is_congested(void *v, int bits)
callbacks);
return md_raid5_congested(&rs->md, bits);
}
+static void raid_unplug(void *v)
+{
+ struct target_callbacks *cb = v;
+ struct raid_set *rs = container_of(cb, struct raid_set,
+ callbacks);
+ md_raid5_unplug_device(rs->md.private);
+}
+
/*
* Construct a RAID4/5/6 mapping:
* Args:
@@ -289,6 +297,7 @@ static int raid_ctr(struct dm_target *ti, unsigned argc, char **argv)
goto err;
clear_bit(In_sync, &rs->dev[rebuildA].rdev.flags);
rs->dev[rebuildA].rdev.recovery_offset = 0;
+ rs->callbacks.unplug_fn = raid_unplug;
}
if (rebuildB >= 0) {
if (rs->dev[rebuildB].dev == NULL)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index b856340..cad4992 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1228,6 +1228,7 @@ void dm_table_unplug_all(struct dm_table *t)
{
struct dm_dev_internal *dd;
struct list_head *devices = dm_table_get_devices(t);
+ struct target_callbacks *cb;
list_for_each_entry(dd, devices, list) {
struct request_queue *q = bdev_get_queue(dd->dm_dev.bdev);
@@ -1240,6 +1241,9 @@ void dm_table_unplug_all(struct dm_table *t)
dm_device_name(t->md),
bdevname(dd->dm_dev.bdev, b));
}
+ list_for_each_entry(cb, &t->target_callbacks, list)
+ if (cb->unplug_fn)
+ cb->unplug_fn(cb);
}
struct mapped_device *dm_table_get_md(struct dm_table *t)
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 2b0f538..5b8ac19 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -191,6 +191,7 @@ struct dm_target {
struct target_callbacks {
struct list_head list;
congested_fn *congested_fn;
+ void (*unplug_fn)(void *);
};
int dm_register_target(struct target_type *t);
next prev parent reply other threads:[~2010-07-26 3:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-26 3:24 [PATCH 0/8] The DM part of dm-raid45 NeilBrown
2010-07-26 3:24 ` [PATCH 8/8] dm-raid456: switch to use dm_dirty_log for tracking dirty regions NeilBrown
2010-07-26 3:24 ` [PATCH 1/8] md/dm: create dm-raid456 module using md/raid5 NeilBrown
2010-07-26 3:24 ` [PATCH 6/8] dm-raid456: add message handler NeilBrown
2010-07-26 3:24 ` [PATCH 2/8] dm-raid456: add congestion checking NeilBrown
2010-07-26 3:24 ` NeilBrown [this message]
2010-07-26 3:24 ` [PATCH 4/8] dm-raid456: add support for setting IO hints NeilBrown
2010-07-26 3:24 ` [PATCH 5/8] dm-raid456: add suspend/resume method NeilBrown
2010-07-26 3:24 ` [PATCH 7/8] dm-dirty-log: allow log size to be different from target size NeilBrown
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=20100726032435.29687.63743.stgit@localhost.localdomain \
--to=nfbrown@novell.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=heinzm@redhat.com \
--cc=linux-raid@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).