From: NeilBrown <neilb@suse.de>
To: dm-devel@redhat.com
Cc: linux-raid@vger.kernel.org
Subject: [PATCH 11/12] dm-raid456: add suspend/resume method
Date: Thu, 15 Apr 2010 16:43:02 +1000 [thread overview]
Message-ID: <20100415064302.15646.44263.stgit@notabene.brown> (raw)
In-Reply-To: <20100415062909.15646.16.stgit@notabene.brown>
These just call in to the md methods.
Signed-off-by: NeilBrown <neilb@suse.de>
---
drivers/md/dm-raid456.c | 15 +++++++++++++++
drivers/md/md.c | 6 ++++--
drivers/md/md.h | 3 +++
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm-raid456.c b/drivers/md/dm-raid456.c
index 071a8ae..126042d 100644
--- a/drivers/md/dm-raid456.c
+++ b/drivers/md/dm-raid456.c
@@ -465,6 +465,19 @@ static void raid_io_hints(struct dm_target *ti,
(conf->raid_disks - conf->max_degraded));
}
+static void raid_presuspend(struct dm_target *ti)
+{
+ struct raid_set *rs = ti->private;
+ mddev_suspend(&rs->md);
+}
+
+static void raid_resume(struct dm_target *ti)
+{
+ struct raid_set *rs = ti->private;
+
+ mddev_resume(&rs->md);
+}
+
static struct target_type raid_target = {
.name = "raid45",
.version = {1, 0, 0},
@@ -475,6 +488,8 @@ static struct target_type raid_target = {
.status = raid_status,
.iterate_devices = raid_iterate_devices,
.io_hints = raid_io_hints,
+ .presuspend = raid_presuspend,
+ .resume = raid_resume,
};
static int __init dm_raid_init(void)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b292dc5..098f72c 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -260,7 +260,7 @@ static int md_make_request(struct request_queue *q, struct bio *bio)
* Once ->stop is called and completes, the module will be completely
* unused.
*/
-static void mddev_suspend(mddev_t *mddev)
+void mddev_suspend(mddev_t *mddev)
{
BUG_ON(mddev->suspended);
mddev->suspended = 1;
@@ -268,13 +268,15 @@ static void mddev_suspend(mddev_t *mddev)
wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0);
mddev->pers->quiesce(mddev, 1);
}
+EXPORT_SYMBOL_GPL(mddev_suspend);
-static void mddev_resume(mddev_t *mddev)
+void mddev_resume(mddev_t *mddev)
{
mddev->suspended = 0;
wake_up(&mddev->sb_wait);
mddev->pers->quiesce(mddev, 0);
}
+EXPORT_SYMBOL_GPL(mddev_resume);
int mddev_congested(mddev_t *mddev, int bits)
{
diff --git a/drivers/md/md.h b/drivers/md/md.h
index e4f60ae..fac75bd 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -506,4 +506,7 @@ extern void mddev_init(mddev_t *mddev);
extern int md_run(mddev_t *mddev);
extern void md_stop(mddev_t *mddev);
extern void md_rdev_init(mdk_rdev_t *rdev);
+
+extern void mddev_suspend(mddev_t *mddev);
+extern void mddev_resume(mddev_t *mddev);
#endif /* _MD_MD_H */
next prev parent reply other threads:[~2010-04-15 6:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 6:43 [PATCH 00/12] A dm-raid45 target implemented using md raid5 NeilBrown
2010-04-15 6:43 ` [PATCH 06/12] dm-raid456: add congestion checking NeilBrown
2010-04-15 6:43 ` [PATCH 12/12] dm-raid456: add message handler NeilBrown
2010-04-15 6:43 ` [PATCH 05/12] raid5: Don't set read-ahead when there is no queue NeilBrown
2010-04-15 6:43 ` NeilBrown [this message]
2010-04-15 6:43 ` [PATCH 03/12] md/dm: create dm-raid456 module using md/raid5 NeilBrown
2010-04-15 6:43 ` [PATCH 01/12] md: reduce dependence on sysfs NeilBrown
2010-04-15 6:43 ` [PATCH 08/12] md/plug: optionally use plugger to unplug an array during resync/recovery NeilBrown
2010-04-15 6:43 ` [PATCH 07/12] md/raid5: add simple plugging infrastructure NeilBrown
2010-04-15 6:43 ` [PATCH 09/12] dm-raid456: support unplug NeilBrown
2010-04-15 6:43 ` [PATCH 04/12] dm-raid456: add support for raising events to userspace NeilBrown
2010-04-15 6:43 ` [PATCH 10/12] dm-raid456: add support for setting IO hints NeilBrown
2010-04-15 6:43 ` [PATCH 02/12] md/raid5: factor out code for changing size of stripe cache NeilBrown
2010-04-15 8:52 ` [PATCH 00/12] A dm-raid45 target implemented using md raid5 Jeff Garzik
2010-04-15 17:27 ` [dm-devel] " Heinz Mauelshagen
2010-04-15 22:14 ` Neil Brown
2010-04-16 9:27 ` Heinz Mauelshagen
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=20100415064302.15646.44263.stgit@notabene.brown \
--to=neilb@suse.de \
--cc=dm-devel@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).