Lines Matching refs:disk
12 struct gendisk *disk) in bd_find_holder_disk() argument
16 list_for_each_entry(holder, &disk->slave_bdevs, list) in bd_find_holder_disk()
60 int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) in bd_link_disk_holder() argument
65 if (WARN_ON_ONCE(!disk->slave_dir)) in bd_link_disk_holder()
68 if (bdev->bd_disk == disk) in bd_link_disk_holder()
83 mutex_lock(&disk->open_mutex); in bd_link_disk_holder()
86 holder = bd_find_holder_disk(bdev, disk); 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()
109 list_add(&holder->list, &disk->slave_bdevs); in bd_link_disk_holder()
111 mutex_unlock(&disk->open_mutex); in bd_link_disk_holder()
115 del_symlink(disk->slave_dir, bdev_kobj(bdev)); in bd_link_disk_holder()
119 mutex_unlock(&disk->open_mutex); in bd_link_disk_holder()
136 void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk) in bd_unlink_disk_holder() argument
140 if (WARN_ON_ONCE(!disk->slave_dir)) in bd_unlink_disk_holder()
143 mutex_lock(&disk->open_mutex); in bd_unlink_disk_holder()
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()
147 del_symlink(holder->holder_dir, &disk_to_dev(disk)->kobj); in bd_unlink_disk_holder()
152 mutex_unlock(&disk->open_mutex); in bd_unlink_disk_holder()