linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 6/8] dm-raid456: add message handler.
Date: Mon, 26 Jul 2010 13:24:35 +1000	[thread overview]
Message-ID: <20100726032435.29687.88413.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100726032230.29687.5366.stgit@localhost.localdomain>

Support messages to:
 - change the size of the stripe cache
 - change the speed limiter on resync.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 drivers/md/dm-raid456.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/drivers/md/dm-raid456.c b/drivers/md/dm-raid456.c
index e2546fc..a2567b0 100644
--- a/drivers/md/dm-raid456.c
+++ b/drivers/md/dm-raid456.c
@@ -485,6 +485,31 @@ static void raid_resume(struct dm_target *ti)
 	mddev_resume(&rs->md);
 }
 
+/* Parse and handle a message from userspace
+ * Messages are:
+ *    stripecache  N  (pages per devices)
+ *    minspeed  N          (kibibytes per seconds)
+ */
+static int raid_message(struct dm_target *ti, unsigned argc, char **argv)
+{
+	struct raid_set *rs = ti->private;
+
+	if (argc == 2 && strcmp(argv[0], "stripecache") == 0) {
+		unsigned long size;
+		if (strict_strtoul(argv[1], 10, &size))
+			return -EINVAL;
+		return raid5_set_cache_size(&rs->md, size);
+	}
+	if (argc == 2 && strcmp(argv[0], "minspeed") == 0) {
+		unsigned long speed;
+		if (strict_strtoul(argv[1], 10, &speed))
+			return -EINVAL;
+		rs->md.sync_speed_min = speed;
+		return 0;
+	}
+	return -EINVAL;
+}
+
 static struct target_type raid_target = {
 	.name = "raid45",
 	.version = {1, 0, 0},
@@ -498,6 +523,7 @@ static struct target_type raid_target = {
 	.presuspend = raid_presuspend,
 	.postsuspend = raid_postsuspend,
 	.resume = raid_resume,
+	.message = raid_message,
 };
 
 static int __init dm_raid_init(void)



  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 4/8] dm-raid456: add support for setting IO hints NeilBrown
2010-07-26  3:24 ` [PATCH 7/8] dm-dirty-log: allow log size to be different from target size NeilBrown
2010-07-26  3:24 ` [PATCH 5/8] dm-raid456: add suspend/resume method 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 3/8] dm-raid456: support unplug 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.88413.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).