linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: majianpeng <majianpeng@gmail.com>
To: NeilBrown <neilb@suse.de>, agk <agk@redhat.com>
Cc: linux-raid <linux-raid@vger.kernel.org>, dm-devel <dm-devel@redhat.com>
Subject: [PATCH 1/3] md:Add a func 'dm_md_stop' for dm-raid to clear up md resources.
Date: Thu, 15 Nov 2012 16:46:59 +0800	[thread overview]
Message-ID: <201211151646546882035@gmail.com> (raw)

Because dm-raid used md driver, when stoped dm-raid it only call
md_stop. It caused some resources omited, like bitmap, mddev->bio_set.
So add a func dm_md_stop to clear up resource.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
---
 drivers/md/md.c |    9 +++++++++
 drivers/md/md.h |    1 +
 2 files changed, 10 insertions(+)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 9ab768a..574b0a8 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5306,6 +5306,15 @@ void md_stop(struct mddev *mddev)
 }
 EXPORT_SYMBOL_GPL(md_stop);
 
+void dm_md_stop(struct mddev *mddev)
+{
+	md_stop(mddev);
+	bitmap_destroy(mddev);
+	if (mddev->bio_set)
+		bioset_free(mddev->bio_set);
+}
+EXPORT_SYMBOL_GPL(dm_md_stop);
+
 static int md_set_readonly(struct mddev *mddev, struct block_device *bdev)
 {
 	int err = 0;
diff --git a/drivers/md/md.h b/drivers/md/md.h
index af443ab..a370ece 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -621,6 +621,7 @@ extern void md_stop(struct mddev *mddev);
 extern void md_stop_writes(struct mddev *mddev);
 extern int md_rdev_init(struct md_rdev *rdev);
 extern void md_rdev_clear(struct md_rdev *rdev);
+extern void dm_md_stop(struct mddev *mddev);
 
 extern void mddev_suspend(struct mddev *mddev);
 extern void mddev_resume(struct mddev *mddev);
-- 
1.7.9.5

             reply	other threads:[~2012-11-15  8:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-15  8:46 majianpeng [this message]
2012-11-15 11:45 ` [PATCH 1/3] md:Add a func 'dm_md_stop' for dm-raid to clear up md resources Alasdair G Kergon
2012-11-15 11:51   ` majianpeng
2012-11-15 13:52     ` Mike Snitzer

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=201211151646546882035@gmail.com \
    --to=majianpeng@gmail.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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).