Dan Williams: let '-a' be specified for Incremental mode

Martin F. Krafft madduck at alioth.debian.org
Wed Jun 25 15:42:30 UTC 2008


Module: mdadm
Branch: build
Commit: 95b79df03ebbb2c80b6a3bbe317b983d7cebe9cc
URL:    http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commit;h=95b79df03ebbb2c80b6a3bbe317b983d7cebe9cc

Author: Dan Williams <dan.j.williams at intel.com>
Date:   Mon May  5 21:55:37 2008 +1000

let '-a' be specified for Incremental mode

From: Dan Williams <dan.j.williams at intel.com>

Signed-off-by: Dan Williams <dan.j.williams at intel.com>

---

 mdadm.c |    4 +++-
 util.c  |    7 +++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/mdadm.c b/mdadm.c
index b4b503d..f2a7bcd 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -199,7 +199,8 @@ int main(int argc, char *argv[])
 		case 'G': newmode = GROW;
 			shortopt = short_bitmap_options;
 			break;
-		case 'I': newmode = INCREMENTAL; break;
+		case 'I': newmode = INCREMENTAL;
+			shortopt = short_bitmap_auto_options; break;
 		case AutoDetect:
 			newmode = AUTODETECT; break;
 
@@ -511,6 +512,7 @@ int main(int argc, char *argv[])
 
 		case O(CREATE,'a'):
 		case O(BUILD,'a'):
+		case O(INCREMENTAL,'a'):
 		case O(ASSEMBLE,'a'): /* auto-creation of device node */
 			autof = parse_auto(optarg, "--auto flag", 0);
 			continue;
diff --git a/util.c b/util.c
index 514b713..108f3c1 100644
--- a/util.c
+++ b/util.c
@@ -884,11 +884,14 @@ int find_free_devnum(int use_partitions)
 	for (devnum = 127; devnum != 128;
 	     devnum = devnum ? devnum-1 : (1<<22)-1) {
 		char *dn;
-		if (mddev_busy(use_partitions ? (-1-devnum) : devnum))
+		int _devnum;
+
+		_devnum = use_partitions ? (-1-devnum) : devnum;
+		if (mddev_busy(_devnum))
 			continue;
 		/* make sure it is new to /dev too, at least as a
 		 * non-standard */
-		dn = map_dev(dev2major(devnum), dev2minor(devnum), 0);
+		dn = map_dev(dev2major(_devnum), dev2minor(_devnum), 0);
 		if (dn && ! is_standard(dn, NULL))
 			continue;
 		break;




More information about the pkg-mdadm-commits mailing list