block: implement and use {disk|part}_to_dev()
Implement {disk|part}_to_dev() and use them to access generic device instead of directly dereferencing {disk|part}->dev. To make sure no user is left behind, rename generic devices fields to __dev. This is in preparation of unifying partition 0 handling with other partitions. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
@ -543,9 +543,9 @@ EXPORT_SYMBOL(bd_release);
|
||||
static struct kobject *bdev_get_kobj(struct block_device *bdev)
|
||||
{
|
||||
if (bdev->bd_contains != bdev)
|
||||
return kobject_get(&bdev->bd_part->dev.kobj);
|
||||
return kobject_get(&part_to_dev(bdev->bd_part)->kobj);
|
||||
else
|
||||
return kobject_get(&bdev->bd_disk->dev.kobj);
|
||||
return kobject_get(&disk_to_dev(bdev->bd_disk)->kobj);
|
||||
}
|
||||
|
||||
static struct kobject *bdev_get_holder(struct block_device *bdev)
|
||||
|
Reference in New Issue
Block a user