aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-05-21 16:08:01 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:36 -0500
commitedfaa7c36574f1bf09c65ad602412db9da5f96bf (patch)
treed591b80ff9229e4845e41d68e2f4c5aadb017027 /drivers/md
parent09f82ea92822a7bbb7e816508abbda47ed54a77f (diff)
Driver core: convert block from raw kobjects to core devices
This moves the block devices to /sys/class/block. It will create a flat list of all block devices, with the disks and partitions in one directory. For compatibility /sys/block is created and contains symlinks to the disks. /sys/class/block |-- sda -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda |-- sda1 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda1 |-- sda10 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda10 |-- sda5 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda5 |-- sda6 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda6 |-- sda7 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda7 |-- sda8 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8 |-- sda9 -> ../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9 `-- sr0 -> ../../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0 /sys/block/ |-- sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda `-- sr0 -> ../devices/pci0000:00/0000:00:1f.2/host1/target1:0:0/1:0:0:0/block/sr0 Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm.c4
-rw-r--r--drivers/md/md.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 88c0fd657825..f2d24eb3208c 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1109,7 +1109,7 @@ static void event_callback(void *context)
1109 list_splice_init(&md->uevent_list, &uevents); 1109 list_splice_init(&md->uevent_list, &uevents);
1110 spin_unlock_irqrestore(&md->uevent_lock, flags); 1110 spin_unlock_irqrestore(&md->uevent_lock, flags);
1111 1111
1112 dm_send_uevents(&uevents, &md->disk->kobj); 1112 dm_send_uevents(&uevents, &md->disk->dev.kobj);
1113 1113
1114 atomic_inc(&md->event_nr); 1114 atomic_inc(&md->event_nr);
1115 wake_up(&md->eventq); 1115 wake_up(&md->eventq);
@@ -1530,7 +1530,7 @@ out:
1530 *---------------------------------------------------------------*/ 1530 *---------------------------------------------------------------*/
1531void dm_kobject_uevent(struct mapped_device *md) 1531void dm_kobject_uevent(struct mapped_device *md)
1532{ 1532{
1533 kobject_uevent(&md->disk->kobj, KOBJ_CHANGE); 1533 kobject_uevent(&md->disk->dev.kobj, KOBJ_CHANGE);
1534} 1534}
1535 1535
1536uint32_t dm_next_uevent_seq(struct mapped_device *md) 1536uint32_t dm_next_uevent_seq(struct mapped_device *md)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index c5030863d004..f79efb359215 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1396,9 +1396,9 @@ static int bind_rdev_to_array(mdk_rdev_t * rdev, mddev_t * mddev)
1396 goto fail; 1396 goto fail;
1397 1397
1398 if (rdev->bdev->bd_part) 1398 if (rdev->bdev->bd_part)
1399 ko = &rdev->bdev->bd_part->kobj; 1399 ko = &rdev->bdev->bd_part->dev.kobj;
1400 else 1400 else
1401 ko = &rdev->bdev->bd_disk->kobj; 1401 ko = &rdev->bdev->bd_disk->dev.kobj;
1402 if ((err = sysfs_create_link(&rdev->kobj, ko, "block"))) { 1402 if ((err = sysfs_create_link(&rdev->kobj, ko, "block"))) {
1403 kobject_del(&rdev->kobj); 1403 kobject_del(&rdev->kobj);
1404 goto fail; 1404 goto fail;
@@ -3083,7 +3083,7 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data)
3083 add_disk(disk); 3083 add_disk(disk);
3084 mddev->gendisk = disk; 3084 mddev->gendisk = disk;
3085 mutex_unlock(&disks_mutex); 3085 mutex_unlock(&disks_mutex);
3086 error = kobject_init_and_add(&mddev->kobj, &md_ktype, &disk->kobj, 3086 error = kobject_init_and_add(&mddev->kobj, &md_ktype, &disk->dev.kobj,
3087 "%s", "md"); 3087 "%s", "md");
3088 if (error) 3088 if (error)
3089 printk(KERN_WARNING "md: cannot register %s/md - name in use\n", 3089 printk(KERN_WARNING "md: cannot register %s/md - name in use\n",
@@ -3361,7 +3361,7 @@ static int do_md_run(mddev_t * mddev)
3361 3361
3362 mddev->changed = 1; 3362 mddev->changed = 1;
3363 md_new_event(mddev); 3363 md_new_event(mddev);
3364 kobject_uevent(&mddev->gendisk->kobj, KOBJ_CHANGE); 3364 kobject_uevent(&mddev->gendisk->dev.kobj, KOBJ_CHANGE);
3365 return 0; 3365 return 0;
3366} 3366}
3367 3367