Lines Matching refs:bdev

11 static struct bd_holder_disk *bd_find_holder_disk(struct block_device *bdev,  in bd_find_holder_disk()  argument
17 if (holder->holder_dir == bdev->bd_holder_dir) in bd_find_holder_disk()
60 int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) in bd_link_disk_holder() argument
68 if (bdev->bd_disk == disk) in bd_link_disk_holder()
75 mutex_lock(&bdev->bd_disk->open_mutex); in bd_link_disk_holder()
76 if (!disk_live(bdev->bd_disk)) { in bd_link_disk_holder()
77 mutex_unlock(&bdev->bd_disk->open_mutex); in bd_link_disk_holder()
80 kobject_get(bdev->bd_holder_dir); in bd_link_disk_holder()
81 mutex_unlock(&bdev->bd_disk->open_mutex); in bd_link_disk_holder()
84 WARN_ON_ONCE(!bdev->bd_holder); in bd_link_disk_holder()
86 holder = bd_find_holder_disk(bdev, disk); in bd_link_disk_holder()
88 kobject_put(bdev->bd_holder_dir); in bd_link_disk_holder()
101 holder->holder_dir = bdev->bd_holder_dir; in bd_link_disk_holder()
103 ret = add_symlink(disk->slave_dir, bdev_kobj(bdev)); in bd_link_disk_holder()
106 ret = add_symlink(bdev->bd_holder_dir, &disk_to_dev(disk)->kobj); in bd_link_disk_holder()
115 del_symlink(disk->slave_dir, bdev_kobj(bdev)); in bd_link_disk_holder()
121 kobject_put(bdev->bd_holder_dir); in bd_link_disk_holder()
136 void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk) in bd_unlink_disk_holder() argument
144 holder = bd_find_holder_disk(bdev, disk); in bd_unlink_disk_holder()
146 del_symlink(disk->slave_dir, bdev_kobj(bdev)); in bd_unlink_disk_holder()