restripe: allow test code to have an offset on each device.

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>
This commit is contained in:
Piergiorgio Sartor 2011-03-22 10:09:38 +11:00 committed by NeilBrown
parent 89ced23b58
commit b306624e2b
1 changed files with 8 additions and 0 deletions

View File

@ -777,6 +777,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]);