aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/bitmap.c1
-rw-r--r--drivers/md/dm-ioctl.c30
-rw-r--r--drivers/md/dm-snap.c1
-rw-r--r--drivers/md/dm.c2
-rw-r--r--drivers/md/kcopyd.c1
-rw-r--r--drivers/md/md.c31
-rw-r--r--drivers/md/raid5.c2
7 files changed, 4 insertions, 64 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index ebbd2d856256..ecc56765d949 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -20,7 +20,6 @@
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/config.h>
24#include <linux/timer.h> 23#include <linux/timer.h>
25#include <linux/sched.h> 24#include <linux/sched.h>
26#include <linux/list.h> 25#include <linux/list.h>
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 3edb3477f987..d13bb15a8a02 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/wait.h> 14#include <linux/wait.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/devfs_fs_kernel.h>
17#include <linux/dm-ioctl.h> 16#include <linux/dm-ioctl.h>
18#include <linux/hdreg.h> 17#include <linux/hdreg.h>
19 18
@@ -68,14 +67,12 @@ static int dm_hash_init(void)
68{ 67{
69 init_buckets(_name_buckets); 68 init_buckets(_name_buckets);
70 init_buckets(_uuid_buckets); 69 init_buckets(_uuid_buckets);
71 devfs_mk_dir(DM_DIR);
72 return 0; 70 return 0;
73} 71}
74 72
75static void dm_hash_exit(void) 73static void dm_hash_exit(void)
76{ 74{
77 dm_hash_remove_all(0); 75 dm_hash_remove_all(0);
78 devfs_remove(DM_DIR);
79} 76}
80 77
81/*----------------------------------------------------------------- 78/*-----------------------------------------------------------------
@@ -172,25 +169,6 @@ static void free_cell(struct hash_cell *hc)
172} 169}
173 170
174/* 171/*
175 * devfs stuff.
176 */
177static int register_with_devfs(struct hash_cell *hc)
178{
179 struct gendisk *disk = dm_disk(hc->md);
180
181 devfs_mk_bdev(MKDEV(disk->major, disk->first_minor),
182 S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP,
183 DM_DIR "/%s", hc->name);
184 return 0;
185}
186
187static int unregister_with_devfs(struct hash_cell *hc)
188{
189 devfs_remove(DM_DIR"/%s", hc->name);
190 return 0;
191}
192
193/*
194 * The kdev_t and uuid of a device can never change once it is 172 * The kdev_t and uuid of a device can never change once it is
195 * initially inserted. 173 * initially inserted.
196 */ 174 */
@@ -226,7 +204,6 @@ static int dm_hash_insert(const char *name, const char *uuid, struct mapped_devi
226 } 204 }
227 list_add(&cell->uuid_list, _uuid_buckets + hash_str(uuid)); 205 list_add(&cell->uuid_list, _uuid_buckets + hash_str(uuid));
228 } 206 }
229 register_with_devfs(cell);
230 dm_get(md); 207 dm_get(md);
231 dm_set_mdptr(md, cell); 208 dm_set_mdptr(md, cell);
232 up_write(&_hash_lock); 209 up_write(&_hash_lock);
@@ -246,7 +223,6 @@ static void __hash_remove(struct hash_cell *hc)
246 /* remove from the dev hash */ 223 /* remove from the dev hash */
247 list_del(&hc->uuid_list); 224 list_del(&hc->uuid_list);
248 list_del(&hc->name_list); 225 list_del(&hc->name_list);
249 unregister_with_devfs(hc);
250 dm_set_mdptr(hc->md, NULL); 226 dm_set_mdptr(hc->md, NULL);
251 227
252 table = dm_get_table(hc->md); 228 table = dm_get_table(hc->md);
@@ -342,16 +318,11 @@ static int dm_hash_rename(const char *old, const char *new)
342 /* 318 /*
343 * rename and move the name cell. 319 * rename and move the name cell.
344 */ 320 */
345 unregister_with_devfs(hc);
346
347 list_del(&hc->name_list); 321 list_del(&hc->name_list);
348 old_name = hc->name; 322 old_name = hc->name;
349 hc->name = new_name; 323 hc->name = new_name;
350 list_add(&hc->name_list, _name_buckets + hash_str(new_name)); 324 list_add(&hc->name_list, _name_buckets + hash_str(new_name));
351 325
352 /* rename the device node in devfs */
353 register_with_devfs(hc);
354
355 /* 326 /*
356 * Wake up any dm event waiters. 327 * Wake up any dm event waiters.
357 */ 328 */
@@ -1501,7 +1472,6 @@ static struct file_operations _ctl_fops = {
1501static struct miscdevice _dm_misc = { 1472static struct miscdevice _dm_misc = {
1502 .minor = MISC_DYNAMIC_MINOR, 1473 .minor = MISC_DYNAMIC_MINOR,
1503 .name = DM_NAME, 1474 .name = DM_NAME,
1504 .devfs_name = "mapper/control",
1505 .fops = &_ctl_fops 1475 .fops = &_ctl_fops
1506}; 1476};
1507 1477
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 8eea0ddbf5ec..1d0fafda0f76 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -7,7 +7,6 @@
7 */ 7 */
8 8
9#include <linux/blkdev.h> 9#include <linux/blkdev.h>
10#include <linux/config.h>
11#include <linux/ctype.h> 10#include <linux/ctype.h>
12#include <linux/device-mapper.h> 11#include <linux/device-mapper.h>
13#include <linux/fs.h> 12#include <linux/fs.h>
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 3ed2e53b9eb6..c99bf9f01759 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -167,7 +167,7 @@ static void local_exit(void)
167 bioset_free(dm_set); 167 bioset_free(dm_set);
168 168
169 if (unregister_blkdev(_major, _name) < 0) 169 if (unregister_blkdev(_major, _name) < 0)
170 DMERR("devfs_unregister_blkdev failed"); 170 DMERR("unregister_blkdev failed");
171 171
172 _major = 0; 172 _major = 0;
173 173
diff --git a/drivers/md/kcopyd.c b/drivers/md/kcopyd.c
index 73ab875fb158..f1db6eff4857 100644
--- a/drivers/md/kcopyd.c
+++ b/drivers/md/kcopyd.c
@@ -12,7 +12,6 @@
12#include <asm/atomic.h> 12#include <asm/atomic.h>
13 13
14#include <linux/blkdev.h> 14#include <linux/blkdev.h>
15#include <linux/config.h>
16#include <linux/fs.h> 15#include <linux/fs.h>
17#include <linux/init.h> 16#include <linux/init.h>
18#include <linux/list.h> 17#include <linux/list.h>
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");
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index f920e50ea124..7433871f4b3a 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -19,7 +19,6 @@
19 */ 19 */
20 20
21 21
22#include <linux/config.h>
23#include <linux/module.h> 22#include <linux/module.h>
24#include <linux/slab.h> 23#include <linux/slab.h>
25#include <linux/highmem.h> 24#include <linux/highmem.h>
@@ -2827,7 +2826,6 @@ static inline sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *ski
2827 struct stripe_head *sh; 2826 struct stripe_head *sh;
2828 int pd_idx; 2827 int pd_idx;
2829 int raid_disks = conf->raid_disks; 2828 int raid_disks = conf->raid_disks;
2830 int data_disks = raid_disks - conf->max_degraded;
2831 sector_t max_sector = mddev->size << 1; 2829 sector_t max_sector = mddev->size << 1;
2832 int sync_blocks; 2830 int sync_blocks;
2833 int still_degraded = 0; 2831 int still_degraded = 0;