Commit 82cbc11a4146d6a8acd81f81f7fe17387668107f
Committed by
Arjan van de Ven
1 parent
02c15def84
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 21 additions and 15 deletions Side-by-side Diff
init/do_mounts_md.c
... | ... | @@ -264,27 +264,33 @@ |
264 | 264 | __setup("raid=", raid_setup); |
265 | 265 | __setup("md=", md_setup); |
266 | 266 | |
267 | +static 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 | + | |
267 | 286 | void __init md_run_setup(void) |
268 | 287 | { |
269 | 288 | create_dev("/dev/md0", MKDEV(MD_MAJOR, 0)); |
270 | 289 | |
271 | 290 | if (raid_noautodetect) |
272 | 291 | printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n"); |
273 | - else { | |
274 | - /* | |
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 | - } | |
292 | + else | |
293 | + autodetect_raid(); | |
288 | 294 | md_setup_drive(); |
289 | 295 | } |