summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-04-05 04:55:58 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-04-05 04:55:58 +0000
commit74a9f2e1b4d3ab45a9f72cb5b556c9f521524ab3 (patch)
tree7c4cdb103ab1b388c9852a88bd6fb1e73eba0b5c /drivers/md
parentee6374c8b0d333c08061c6a97bc77090d7461225 (diff)
Merge with Linux 2.4.3.
Note that mingetty does no longer work with serial console, you have to switch to another getty like getty_ps. This commit also includes a fix for a setitimer bug which did prevent getty_ps from working on older kernels.
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/md.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index b2ed89dcc..fc0a91a7b 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -682,6 +682,8 @@ static void unlock_rdev (mdk_rdev_t *rdev)
rdev->bdev = NULL;
}
+void md_autodetect_dev (kdev_t dev);
+
static void export_rdev (mdk_rdev_t * rdev)
{
printk("export_rdev(%s)\n",partition_name(rdev->dev));
@@ -696,6 +698,9 @@ static void export_rdev (mdk_rdev_t * rdev)
md_list_del(&rdev->pending);
MD_INIT_LIST_HEAD(&rdev->pending);
}
+#ifndef MODULE
+ md_autodetect_dev(rdev->dev);
+#endif
rdev->dev = 0;
rdev->faulty = 0;
kfree(rdev);
@@ -3525,6 +3530,7 @@ static void md_geninit (void)
int md__init md_init (void)
{
static char * name = "mdrecoveryd";
+ int minor;
printk (KERN_INFO "md driver %d.%d.%d MAX_MD_DEVS=%d, MD_SB_DISKS=%d\n",
MD_MAJOR_VERSION, MD_MINOR_VERSION,
@@ -3536,9 +3542,14 @@ int md__init md_init (void)
return (-1);
}
devfs_handle = devfs_mk_dir (NULL, "md", NULL);
- devfs_register_series (devfs_handle, "%u",MAX_MD_DEVS,DEVFS_FL_DEFAULT,
- MAJOR_NR, 0, S_IFBLK | S_IRUSR | S_IWUSR,
- &md_fops, NULL);
+ /* we don't use devfs_register_series because we want to fill md_hd_struct */
+ for (minor=0; minor < MAX_MD_DEVS; ++minor) {
+ char devname[128];
+ sprintf (devname, "%u", minor);
+ md_hd_struct[minor].de = devfs_register (devfs_handle,
+ devname, DEVFS_FL_DEFAULT, MAJOR_NR, minor,
+ S_IFBLK | S_IRUSR | S_IWUSR, &md_fops, NULL);
+ }
/* forward all md request to md_make_request */
blk_queue_make_request(BLK_DEFAULT_QUEUE(MAJOR_NR), md_make_request);
@@ -3581,10 +3592,10 @@ struct {
* Searches all registered partitions for autorun RAID arrays
* at boot time.
*/
-static int detected_devices[128] md__initdata;
+static int detected_devices[128];
static int dev_cnt;
-void md_autodetect_dev(kdev_t dev)
+void md_autodetect_dev (kdev_t dev)
{
if (dev_cnt >= 0 && dev_cnt < 127)
detected_devices[dev_cnt++] = dev;
@@ -3598,7 +3609,7 @@ static void autostart_arrays (void)
printk(KERN_INFO "autodetecting RAID arrays\n");
- for (i=0; i<dev_cnt; i++) {
+ for (i = 0; i < dev_cnt; i++) {
kdev_t dev = detected_devices[i];
if (md_import_device(dev,1)) {
@@ -3620,6 +3631,7 @@ static void autostart_arrays (void)
}
md_list_add(&rdev->pending, &pending_raid_disks);
}
+ dev_cnt = 0;
autorun_devices(-1);
}
@@ -3656,7 +3668,7 @@ static int md__init md_setup(char *str)
kdev_t device;
char *devnames, *pername = "";
- if(get_option(&str, &minor) != 2) { /* MD Number */
+ if (get_option(&str, &minor) != 2) { /* MD Number */
printk("md: Too few arguments supplied to md=.\n");
return 0;
}
@@ -3667,7 +3679,7 @@ static int md__init md_setup(char *str)
printk ("md: Warning - md=%d,... has been specified twice;\n"
" will discard the first definition.\n", minor);
}
- switch(get_option(&str, &level)) { /* RAID Personality */
+ switch (get_option(&str, &level)) { /* RAID Personality */
case 2: /* could be 0 or -1.. */
if (level == 0 || level == -1) {
if (get_option(&str, &factor) != 2 || /* Chunk Size */
@@ -3820,7 +3832,6 @@ int md__init md_run_setup(void)
printk(KERN_INFO "skipping autodetection of RAID arrays\n");
else
autostart_arrays();
- dev_cnt = -1; /* make sure further calls to md_autodetect_dev are ignored */
md_setup_drive();
return 0;
}