8 #warning "Sparse checking disabled for this file"
12 #include <linux/raid/md_u.h>
26 #ifdef CONFIG_MD_AUTODETECT
79 for (ent=0 ; ent< md_setup_ents ; ent++)
80 if (md_setup_args[ent].minor == minor &&
81 md_setup_args[ent].partitioned == partitioned) {
83 "Replacing previous definition.\n", partitioned?
"d":
"", minor);
87 printk(
KERN_WARNING "md: md=%s%d - too many md initialisations\n", partitioned?
"d":
"", minor);
90 if (ent >= md_setup_ents)
100 md_setup_args[ent].level =
level;
101 md_setup_args[ent].chunk = 1 << (factor+12);
114 pername=
"super-block";
118 minor, pername, str);
119 md_setup_args[ent].device_names =
str;
121 md_setup_args[ent].minor = minor;
126 static void __init md_setup_drive(
void)
132 for (ent = 0; ent < md_setup_ents ; ent++) {
139 minor = md_setup_args[ent].minor;
140 partitioned = md_setup_args[ent].partitioned;
141 devname = md_setup_args[ent].device_names;
143 sprintf(name,
"/dev/md%s%d", partitioned?
"_d":
"", minor);
148 create_dev(name, dev);
159 if (
strncmp(devname,
"/dev/", 5) == 0)
161 snprintf(comp_name, 63,
"/dev/%s", devname);
162 rdev = bstat(comp_name);
164 dev = new_decode_dev(rdev);
180 partitioned ?
"_d" :
"", minor,
191 "md: Ignoring md=%d, already autodetected. (Use raid=noautodetect)\n",
200 ainfo.
level = md_setup_args[ent].level;
253 static int __init raid_setup(
char *str)
261 char *comma =
strchr(str+pos,
',');
264 wlen = (comma-
str)-pos;
265 else wlen = (len-1)-pos;
267 if (!
strncmp(str,
"noautodetect", wlen))
268 raid_noautodetect = 1;
269 if (!
strncmp(str,
"autodetect", wlen))
270 raid_noautodetect = 0;
271 if (
strncmp(str,
"partitionable", wlen)==0)
273 if (
strncmp(str,
"part", wlen)==0)
283 static void __init autodetect_raid(
void)
291 printk(
KERN_INFO "md: Waiting for all devices to be available before autodetect\n");
292 printk(
KERN_INFO "md: If you don't use raid, use raid=noautodetect\n");
307 if (raid_noautodetect)
308 printk(
KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=autodetect will force)\n");