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()
32 static int __link_disk_holder(struct block_device *bdev, struct gendisk *disk) in __link_disk_holder() argument
36 ret = add_symlink(disk->slave_dir, bdev_kobj(bdev)); in __link_disk_holder()
39 ret = add_symlink(bdev->bd_holder_dir, &disk_to_dev(disk)->kobj); in __link_disk_holder()
41 del_symlink(disk->slave_dir, bdev_kobj(bdev)); in __link_disk_holder()
73 int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) in bd_link_disk_holder() argument
78 mutex_lock(&disk->open_mutex); in bd_link_disk_holder()
82 holder = bd_find_holder_disk(bdev, disk); in bd_link_disk_holder()
97 if (disk->slave_dir) { in bd_link_disk_holder()
98 ret = __link_disk_holder(bdev, disk); in bd_link_disk_holder()
105 list_add(&holder->list, &disk->slave_bdevs); in bd_link_disk_holder()
113 mutex_unlock(&disk->open_mutex); in bd_link_disk_holder()
119 struct gendisk *disk) in __unlink_disk_holder() argument
121 del_symlink(disk->slave_dir, bdev_kobj(bdev)); in __unlink_disk_holder()
122 del_symlink(bdev->bd_holder_dir, &disk_to_dev(disk)->kobj); in __unlink_disk_holder()
135 void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk) in bd_unlink_disk_holder() argument
139 mutex_lock(&disk->open_mutex); in bd_unlink_disk_holder()
140 holder = bd_find_holder_disk(bdev, disk); in bd_unlink_disk_holder()
142 if (disk->slave_dir) in bd_unlink_disk_holder()
143 __unlink_disk_holder(bdev, disk); in bd_unlink_disk_holder()
148 mutex_unlock(&disk->open_mutex); in bd_unlink_disk_holder()
152 int bd_register_pending_holders(struct gendisk *disk) in bd_register_pending_holders() argument
157 mutex_lock(&disk->open_mutex); in bd_register_pending_holders()
158 list_for_each_entry(holder, &disk->slave_bdevs, list) { in bd_register_pending_holders()
159 ret = __link_disk_holder(holder->bdev, disk); in bd_register_pending_holders()
163 mutex_unlock(&disk->open_mutex); in bd_register_pending_holders()
167 list_for_each_entry_continue_reverse(holder, &disk->slave_bdevs, list) in bd_register_pending_holders()
168 __unlink_disk_holder(holder->bdev, disk); in bd_register_pending_holders()
169 mutex_unlock(&disk->open_mutex); in bd_register_pending_holders()