patch to init/main.c to support linear RAID

qvha (qvha@ubisoft.com)
Thu, 29 Oct 1998 11:19:15 -0800


This is a multi-part message in MIME format.
--------------55A00365A861B0194824CA60
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

I've noticed that get_options in init/main.c only takes positive
integers on the command line.

However, according to Documentation/md.txt, linear RAID (append)
requires -1 to be entered.
--------------55A00365A861B0194824CA60
Content-Type: text/plain; charset=us-ascii; name="main.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="main.patch"

--- main.c.old Thu Oct 8 17:25:16 1998
+++ main.c Thu Oct 29 11:11:38 1998
@@ -7,6 +7,7 @@
* Added initrd & change_root: Werner Almesberger & Hans Lermen, Feb '96
* Moan early if gcc is old, avoiding bogus kernels - Paul Gortmaker, May '96
* Simplified starting of init: Michael A. Griffith <grif@acm.org>
+ * get_options takes negative integers for linear RAID (-1) - HA Quoc-Viet Oct'98
*/

#define __KERNEL_SYSCALLS__
@@ -374,10 +375,17 @@
char *get_options(char *str, int *ints)
{
char *cur = str;
- int i=1;
+ int i=1,sign=1;

- while (cur && isdigit(*cur) && i <= 10) {
- ints[i++] = simple_strtoul(cur,NULL,0);
+ while ( cur && i<=10 &&
+ ( ( *cur=='-' && isdigit(cur[1]) ) || isdigit(*cur) ) )
+ {
+ if ( *cur=='-' )
+ {
+ sign=-1;
+ cur++;
+ }
+ ints[i++] = sign * simple_strtoul(cur,NULL,0);
if ((cur = strchr(cur,',')) != NULL)
cur++;
}

--------------55A00365A861B0194824CA60--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/