From patchwork Fri Dec 3 19:55:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonthan Brassow X-Patchwork-Id: 378971 Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB3Jv18F008077 for ; Fri, 3 Dec 2010 19:57:21 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oB3JtH3Q009499; Fri, 3 Dec 2010 14:55:18 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oB3JtGrM000849 for ; Fri, 3 Dec 2010 14:55:16 -0500 Received: from hydrogen.msp.redhat.com (hydrogen.msp.redhat.com [10.15.80.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oB3JtAww010023 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 3 Dec 2010 14:55:10 -0500 Received: from hydrogen.msp.redhat.com ([127.0.0.1]) by hydrogen.msp.redhat.com (8.14.1/8.14.1) with ESMTP id oB3Jt9Ue003390; Fri, 3 Dec 2010 13:55:09 -0600 Received: (from jbrassow@localhost) by hydrogen.msp.redhat.com (8.14.1/8.14.1/Submit) id oB3Jt9Zm003389; Fri, 3 Dec 2010 13:55:09 -0600 Date: Fri, 3 Dec 2010 13:55:09 -0600 From: Jonathan Brassow Message-Id: <201012031955.oB3Jt9Zm003389@hydrogen.msp.redhat.com> To: dm-devel@redhat.com X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH 9 of 15] dm raid message fn X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 03 Dec 2010 19:57:21 +0000 (UTC) Index: linux-2.6/drivers/md/dm-raid.c =================================================================== --- linux-2.6.orig/drivers/md/dm-raid.c +++ linux-2.6/drivers/md/dm-raid.c @@ -504,6 +504,31 @@ static void raid_resume(struct dm_target 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 = "raid", .version = {1, 0, 0}, @@ -517,6 +542,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)