aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-08-18 06:54:00 -0400
committerArjan van de Ven <arjan@linux.intel.com>2008-10-12 11:24:34 -0400
commit82cbc11a4146d6a8acd81f81f7fe17387668107f (patch)
tree9d1390d70610228e83f22b4f0870d37c3e3d9ccf /init
parent02c15def8400a974fbce02b4f2d65b38c839e88b (diff)
warning: fix init do_mounts_md c
fix warning: init/do_mounts_md.c: In function ‘md_run_setup’: init/do_mounts_md.c:282: warning: ISO C90 forbids mixed declarations and code also, use the opportunity to put the RAID autodetection code into a separate function - this also solves a checkpatch style warning. No code changed: md5: aa36a35faef371b05f1974ad583bdbbd do_mounts_md.o.before.asm aa36a35faef371b05f1974ad583bdbbd do_mounts_md.o.after.asm Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'init')
-rw-r--r--init/do_mounts_md.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c
index 1ec5c41c8a3c..c0dfd3c1e91b 100644
--- a/init/do_mounts_md.c
+++ b/init/do_mounts_md.c
@@ -264,26 +264,32 @@ static int __init raid_setup(char *str)
264__setup("raid=", raid_setup); 264__setup("raid=", raid_setup);
265__setup("md=", md_setup); 265__setup("md=", md_setup);
266 266
267static void autodetect_raid(void)
268{
269 int fd;
270
271 /*
272 * Since we don't want to detect and use half a raid array, we need to
273 * wait for the known devices to complete their probing
274 */
275 printk(KERN_INFO "md: Waiting for all devices to be available before autodetect\n");
276 printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n");
277 while (driver_probe_done() < 0)
278 msleep(100);
279 fd = sys_open("/dev/md0", 0, 0);
280 if (fd >= 0) {
281 sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
282 sys_close(fd);
283 }
284}
285
267void __init md_run_setup(void) 286void __init md_run_setup(void)
268{ 287{
269 create_dev("/dev/md0", MKDEV(MD_MAJOR, 0)); 288 create_dev("/dev/md0", MKDEV(MD_MAJOR, 0));
270 289
271 if (raid_noautodetect) 290 if (raid_noautodetect)
272 printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n"); 291 printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n");
273 else { 292 else
274 /* 293 autodetect_raid();
275 * Since we don't want to detect and use half a raid array, we need to
276 * wait for the known devices to complete their probing
277 */
278 printk(KERN_INFO "md: Waiting for all devices to be available before autodetect\n");
279 printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n");
280 while (driver_probe_done() < 0)
281 msleep(100);
282 int fd = sys_open("/dev/md0", 0, 0);
283 if (fd >= 0) {
284 sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
285 sys_close(fd);
286 }
287 }
288 md_setup_drive(); 294 md_setup_drive();
289} 295}