Re: [PATCH] Re: User space RAID-6 access

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> As this is really just for testing, I would add a :offset  suffix to the
> device names where the offset is in sectors.
> So:
>    /dev/sda
> means read from the start of /dev/sda
> 
>    /dev/sda:2048
> 
> means start 1Meg into /dev/sda.
> 
> That should be easy to parse and is quite general.

Hi again,

please find attached below another mini-patch
which should add the offset option, as discussed.
That is, "/dev/sdX:offset".
It should work with or without the ":offset" tail,
and possibly also with "/dev/sdX:", depending on
"atoll()".

Please consider for inclusion.

Thanks,

bye,


diff -uN a/restripe.c b/restripe.c
--- a/restripe.c	2011-02-18 23:18:20.377740868 +0100
+++ b/restripe.c	2011-02-18 23:30:07.589841525 +0100
@@ -875,6 +875,14 @@
 		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]);

-- 

piergiorgio
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux