]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
restripe: allow test code to have an offset on each device.
authorPiergiorgio Sartor <piergiorgio.sartor@nexgo.de>
Mon, 21 Mar 2011 23:09:38 +0000 (10:09 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 21 Mar 2011 23:09:38 +0000 (10:09 +1100)
If device name ends :number, e.g.
   /dev/sda0:1234

then assume the RAID data starts that many sectors from start of
device.

Signed-off-by: NeilBrown <neilb@suse.de>
restripe.c

index f579a92c87440f85fb69cbf18a4dba45ae6df8fb..906788c4c94699e6e44594b4f9b07f534770d7ac 100644 (file)
@@ -875,6 +875,14 @@ main(int argc, char *argv[])
                exit(3);
        }
        for (i=0; i<raid_disks; i++) {
+               char *p;
+               p = strchr(argv[9+i], ':');
+
+               if(p != NULL) {
+                       *p++ = '\0';
+                       offsets[i] = atoll(p) * 512;
+               }
+                       
                fds[i] = open(argv[9+i], O_RDWR);
                if (fds[i] < 0) {
                        perror(argv[9+i]);