aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c31
1 files changed, 3 insertions, 28 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 306268ec99ff..2fe32c261922 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -33,13 +33,11 @@
33*/ 33*/
34 34
35#include <linux/module.h> 35#include <linux/module.h>
36#include <linux/config.h>
37#include <linux/kthread.h> 36#include <linux/kthread.h>
38#include <linux/linkage.h> 37#include <linux/linkage.h>
39#include <linux/raid/md.h> 38#include <linux/raid/md.h>
40#include <linux/raid/bitmap.h> 39#include <linux/raid/bitmap.h>
41#include <linux/sysctl.h> 40#include <linux/sysctl.h>
42#include <linux/devfs_fs_kernel.h>
43#include <linux/buffer_head.h> /* for invalidate_bdev */ 41#include <linux/buffer_head.h> /* for invalidate_bdev */
44#include <linux/suspend.h> 42#include <linux/suspend.h>
45#include <linux/poll.h> 43#include <linux/poll.h>
@@ -2911,13 +2909,10 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data)
2911 } 2909 }
2912 disk->major = MAJOR(dev); 2910 disk->major = MAJOR(dev);
2913 disk->first_minor = unit << shift; 2911 disk->first_minor = unit << shift;
2914 if (partitioned) { 2912 if (partitioned)
2915 sprintf(disk->disk_name, "md_d%d", unit); 2913 sprintf(disk->disk_name, "md_d%d", unit);
2916 sprintf(disk->devfs_name, "md/d%d", unit); 2914 else
2917 } else {
2918 sprintf(disk->disk_name, "md%d", unit); 2915 sprintf(disk->disk_name, "md%d", unit);
2919 sprintf(disk->devfs_name, "md/%d", unit);
2920 }
2921 disk->fops = &md_fops; 2916 disk->fops = &md_fops;
2922 disk->private_data = mddev; 2917 disk->private_data = mddev;
2923 disk->queue = mddev->queue; 2918 disk->queue = mddev->queue;
@@ -5538,8 +5533,6 @@ static void md_geninit(void)
5538 5533
5539static int __init md_init(void) 5534static int __init md_init(void)
5540{ 5535{
5541 int minor;
5542
5543 printk(KERN_INFO "md: md driver %d.%d.%d MAX_MD_DEVS=%d," 5536 printk(KERN_INFO "md: md driver %d.%d.%d MAX_MD_DEVS=%d,"
5544 " MD_SB_DISKS=%d\n", 5537 " MD_SB_DISKS=%d\n",
5545 MD_MAJOR_VERSION, MD_MINOR_VERSION, 5538 MD_MAJOR_VERSION, MD_MINOR_VERSION,
@@ -5553,23 +5546,11 @@ static int __init md_init(void)
5553 unregister_blkdev(MAJOR_NR, "md"); 5546 unregister_blkdev(MAJOR_NR, "md");
5554 return -1; 5547 return -1;
5555 } 5548 }
5556 devfs_mk_dir("md");
5557 blk_register_region(MKDEV(MAJOR_NR, 0), MAX_MD_DEVS, THIS_MODULE, 5549 blk_register_region(MKDEV(MAJOR_NR, 0), MAX_MD_DEVS, THIS_MODULE,
5558 md_probe, NULL, NULL); 5550 md_probe, NULL, NULL);
5559 blk_register_region(MKDEV(mdp_major, 0), MAX_MD_DEVS<<MdpMinorShift, THIS_MODULE, 5551 blk_register_region(MKDEV(mdp_major, 0), MAX_MD_DEVS<<MdpMinorShift, THIS_MODULE,
5560 md_probe, NULL, NULL); 5552 md_probe, NULL, NULL);
5561 5553
5562 for (minor=0; minor < MAX_MD_DEVS; ++minor)
5563 devfs_mk_bdev(MKDEV(MAJOR_NR, minor),
5564 S_IFBLK|S_IRUSR|S_IWUSR,
5565 "md/%d", minor);
5566
5567 for (minor=0; minor < MAX_MD_DEVS; ++minor)
5568 devfs_mk_bdev(MKDEV(mdp_major, minor<<MdpMinorShift),
5569 S_IFBLK|S_IRUSR|S_IWUSR,
5570 "md/mdp%d", minor);
5571
5572
5573 register_reboot_notifier(&md_notifier); 5554 register_reboot_notifier(&md_notifier);
5574 raid_table_header = register_sysctl_table(raid_root_table, 1); 5555 raid_table_header = register_sysctl_table(raid_root_table, 1);
5575 5556
@@ -5625,15 +5606,9 @@ static __exit void md_exit(void)
5625{ 5606{
5626 mddev_t *mddev; 5607 mddev_t *mddev;
5627 struct list_head *tmp; 5608 struct list_head *tmp;
5628 int i; 5609
5629 blk_unregister_region(MKDEV(MAJOR_NR,0), MAX_MD_DEVS); 5610 blk_unregister_region(MKDEV(MAJOR_NR,0), MAX_MD_DEVS);
5630 blk_unregister_region(MKDEV(mdp_major,0), MAX_MD_DEVS << MdpMinorShift); 5611 blk_unregister_region(MKDEV(mdp_major,0), MAX_MD_DEVS << MdpMinorShift);
5631 for (i=0; i < MAX_MD_DEVS; i++)
5632 devfs_remove("md/%d", i);
5633 for (i=0; i < MAX_MD_DEVS; i++)
5634 devfs_remove("md/d%d", i);
5635
5636 devfs_remove("md");
5637 5612
5638 unregister_blkdev(MAJOR_NR,"md"); 5613 unregister_blkdev(MAJOR_NR,"md");
5639 unregister_blkdev(mdp_major, "mdp"); 5614 unregister_blkdev(mdp_major, "mdp");