diff options
Diffstat (limited to 'meta/packages/linux/linux-moblin-2.6.27-rc6/0036-warning-fix-init-do_mounts_md-c.patch')
-rw-r--r-- | meta/packages/linux/linux-moblin-2.6.27-rc6/0036-warning-fix-init-do_mounts_md-c.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/meta/packages/linux/linux-moblin-2.6.27-rc6/0036-warning-fix-init-do_mounts_md-c.patch b/meta/packages/linux/linux-moblin-2.6.27-rc6/0036-warning-fix-init-do_mounts_md-c.patch new file mode 100644 index 0000000000..9ba44a892d --- /dev/null +++ b/meta/packages/linux/linux-moblin-2.6.27-rc6/0036-warning-fix-init-do_mounts_md-c.patch | |||
@@ -0,0 +1,82 @@ | |||
1 | From fa3038625d7df2a1244c5b753069e7fdf99af3b5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ingo Molnar <mingo@elte.hu> | ||
3 | Date: Mon, 18 Aug 2008 12:54:00 +0200 | ||
4 | Subject: [PATCH] warning: fix init do_mounts_md c | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=utf-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | fix warning: | ||
10 | |||
11 | init/do_mounts_md.c: In function ‘md_run_setup’: | ||
12 | init/do_mounts_md.c:282: warning: ISO C90 forbids mixed declarations and code | ||
13 | |||
14 | also, use the opportunity to put the RAID autodetection code | ||
15 | into a separate function - this also solves a checkpatch style warning. | ||
16 | |||
17 | No code changed: | ||
18 | |||
19 | md5: | ||
20 | aa36a35faef371b05f1974ad583bdbbd do_mounts_md.o.before.asm | ||
21 | aa36a35faef371b05f1974ad583bdbbd do_mounts_md.o.after.asm | ||
22 | |||
23 | Signed-off-by: Ingo Molnar <mingo@elte.hu> | ||
24 | --- | ||
25 | init/do_mounts_md.c | 36 +++++++++++++++++++++--------------- | ||
26 | 1 files changed, 21 insertions(+), 15 deletions(-) | ||
27 | |||
28 | diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c | ||
29 | index 1ec5c41..c0dfd3c 100644 | ||
30 | --- a/init/do_mounts_md.c | ||
31 | +++ b/init/do_mounts_md.c | ||
32 | @@ -264,26 +264,32 @@ static int __init raid_setup(char *str) | ||
33 | __setup("raid=", raid_setup); | ||
34 | __setup("md=", md_setup); | ||
35 | |||
36 | +static void autodetect_raid(void) | ||
37 | +{ | ||
38 | + int fd; | ||
39 | + | ||
40 | + /* | ||
41 | + * Since we don't want to detect and use half a raid array, we need to | ||
42 | + * wait for the known devices to complete their probing | ||
43 | + */ | ||
44 | + printk(KERN_INFO "md: Waiting for all devices to be available before autodetect\n"); | ||
45 | + printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n"); | ||
46 | + while (driver_probe_done() < 0) | ||
47 | + msleep(100); | ||
48 | + fd = sys_open("/dev/md0", 0, 0); | ||
49 | + if (fd >= 0) { | ||
50 | + sys_ioctl(fd, RAID_AUTORUN, raid_autopart); | ||
51 | + sys_close(fd); | ||
52 | + } | ||
53 | +} | ||
54 | + | ||
55 | void __init md_run_setup(void) | ||
56 | { | ||
57 | create_dev("/dev/md0", MKDEV(MD_MAJOR, 0)); | ||
58 | |||
59 | if (raid_noautodetect) | ||
60 | printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n"); | ||
61 | - else { | ||
62 | - /* | ||
63 | - * Since we don't want to detect and use half a raid array, we need to | ||
64 | - * wait for the known devices to complete their probing | ||
65 | - */ | ||
66 | - printk(KERN_INFO "md: Waiting for all devices to be available before autodetect\n"); | ||
67 | - printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n"); | ||
68 | - while (driver_probe_done() < 0) | ||
69 | - msleep(100); | ||
70 | - int fd = sys_open("/dev/md0", 0, 0); | ||
71 | - if (fd >= 0) { | ||
72 | - sys_ioctl(fd, RAID_AUTORUN, raid_autopart); | ||
73 | - sys_close(fd); | ||
74 | - } | ||
75 | - } | ||
76 | + else | ||
77 | + autodetect_raid(); | ||
78 | md_setup_drive(); | ||
79 | } | ||
80 | -- | ||
81 | 1.5.4.3 | ||
82 | |||