diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index 306268ec99ff..2ec1b3520a0b 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #include <linux/raid/md.h> | 39 | #include <linux/raid/md.h> |
40 | #include <linux/raid/bitmap.h> | 40 | #include <linux/raid/bitmap.h> |
41 | #include <linux/sysctl.h> | 41 | #include <linux/sysctl.h> |
42 | #include <linux/devfs_fs_kernel.h> | ||
43 | #include <linux/buffer_head.h> /* for invalidate_bdev */ | 42 | #include <linux/buffer_head.h> /* for invalidate_bdev */ |
44 | #include <linux/suspend.h> | 43 | #include <linux/suspend.h> |
45 | #include <linux/poll.h> | 44 | #include <linux/poll.h> |
@@ -2911,13 +2910,10 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data) | |||
2911 | } | 2910 | } |
2912 | disk->major = MAJOR(dev); | 2911 | disk->major = MAJOR(dev); |
2913 | disk->first_minor = unit << shift; | 2912 | disk->first_minor = unit << shift; |
2914 | if (partitioned) { | 2913 | if (partitioned) |
2915 | sprintf(disk->disk_name, "md_d%d", unit); | 2914 | sprintf(disk->disk_name, "md_d%d", unit); |
2916 | sprintf(disk->devfs_name, "md/d%d", unit); | 2915 | else |
2917 | } else { | ||
2918 | sprintf(disk->disk_name, "md%d", unit); | 2916 | sprintf(disk->disk_name, "md%d", unit); |
2919 | sprintf(disk->devfs_name, "md/%d", unit); | ||
2920 | } | ||
2921 | disk->fops = &md_fops; | 2917 | disk->fops = &md_fops; |
2922 | disk->private_data = mddev; | 2918 | disk->private_data = mddev; |
2923 | disk->queue = mddev->queue; | 2919 | disk->queue = mddev->queue; |
@@ -5538,8 +5534,6 @@ static void md_geninit(void) | |||
5538 | 5534 | ||
5539 | static int __init md_init(void) | 5535 | static int __init md_init(void) |
5540 | { | 5536 | { |
5541 | int minor; | ||
5542 | |||
5543 | printk(KERN_INFO "md: md driver %d.%d.%d MAX_MD_DEVS=%d," | 5537 | printk(KERN_INFO "md: md driver %d.%d.%d MAX_MD_DEVS=%d," |
5544 | " MD_SB_DISKS=%d\n", | 5538 | " MD_SB_DISKS=%d\n", |
5545 | MD_MAJOR_VERSION, MD_MINOR_VERSION, | 5539 | MD_MAJOR_VERSION, MD_MINOR_VERSION, |
@@ -5553,23 +5547,11 @@ static int __init md_init(void) | |||
5553 | unregister_blkdev(MAJOR_NR, "md"); | 5547 | unregister_blkdev(MAJOR_NR, "md"); |
5554 | return -1; | 5548 | return -1; |
5555 | } | 5549 | } |
5556 | devfs_mk_dir("md"); | ||
5557 | blk_register_region(MKDEV(MAJOR_NR, 0), MAX_MD_DEVS, THIS_MODULE, | 5550 | blk_register_region(MKDEV(MAJOR_NR, 0), MAX_MD_DEVS, THIS_MODULE, |
5558 | md_probe, NULL, NULL); | 5551 | md_probe, NULL, NULL); |
5559 | blk_register_region(MKDEV(mdp_major, 0), MAX_MD_DEVS<<MdpMinorShift, THIS_MODULE, | 5552 | blk_register_region(MKDEV(mdp_major, 0), MAX_MD_DEVS<<MdpMinorShift, THIS_MODULE, |
5560 | md_probe, NULL, NULL); | 5553 | md_probe, NULL, NULL); |
5561 | 5554 | ||
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); | 5555 | register_reboot_notifier(&md_notifier); |
5574 | raid_table_header = register_sysctl_table(raid_root_table, 1); | 5556 | raid_table_header = register_sysctl_table(raid_root_table, 1); |
5575 | 5557 | ||
@@ -5625,15 +5607,9 @@ static __exit void md_exit(void) | |||
5625 | { | 5607 | { |
5626 | mddev_t *mddev; | 5608 | mddev_t *mddev; |
5627 | struct list_head *tmp; | 5609 | struct list_head *tmp; |
5628 | int i; | 5610 | |
5629 | blk_unregister_region(MKDEV(MAJOR_NR,0), MAX_MD_DEVS); | 5611 | blk_unregister_region(MKDEV(MAJOR_NR,0), MAX_MD_DEVS); |
5630 | blk_unregister_region(MKDEV(mdp_major,0), MAX_MD_DEVS << MdpMinorShift); | 5612 | 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 | 5613 | ||
5638 | unregister_blkdev(MAJOR_NR,"md"); | 5614 | unregister_blkdev(MAJOR_NR,"md"); |
5639 | unregister_blkdev(mdp_major, "mdp"); | 5615 | unregister_blkdev(mdp_major, "mdp"); |