Thread (14 messages) 14 messages, 3 authors, 2011-02-18

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

flat view

From: Piergiorgio Sartor <hidden>
Date: 2011-02-18 23:02:38

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help