mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
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:
parent
870d665612
commit
ed9e198234
11 changed files with 86 additions and 77 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue