Lines Matching refs:disk
916 struct gendisk *disk; in bd_start_claiming() local
926 disk = get_gendisk(bdev->bd_dev, &partno); in bd_start_claiming()
927 if (!disk) in bd_start_claiming()
939 whole = bdget_disk(disk, 0); in bd_start_claiming()
943 module_put(disk->fops->owner); in bd_start_claiming()
944 put_disk(disk); in bd_start_claiming()
966 struct gendisk *disk; member
971 struct gendisk *disk) in bd_find_holder_disk() argument
976 if (holder->disk == disk) in bd_find_holder_disk()
1019 int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) in bd_link_disk_holder() argument
1029 if (WARN_ON(!disk->slave_dir || !bdev->bd_part->holder_dir)) in bd_link_disk_holder()
1032 holder = bd_find_holder_disk(bdev, disk); in bd_link_disk_holder()
1045 holder->disk = disk; in bd_link_disk_holder()
1048 ret = add_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); in bd_link_disk_holder()
1052 ret = add_symlink(bdev->bd_part->holder_dir, &disk_to_dev(disk)->kobj); in bd_link_disk_holder()
1065 del_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); in bd_link_disk_holder()
1084 void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk) in bd_unlink_disk_holder() argument
1090 holder = bd_find_holder_disk(bdev, disk); in bd_unlink_disk_holder()
1093 del_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); in bd_unlink_disk_holder()
1095 &disk_to_dev(disk)->kobj); in bd_unlink_disk_holder()
1138 void check_disk_size_change(struct gendisk *disk, struct block_device *bdev) in check_disk_size_change() argument
1142 disk_size = (loff_t)get_capacity(disk) << 9; in check_disk_size_change()
1147 disk->disk_name, bdev_size, disk_size); in check_disk_size_change()
1162 int revalidate_disk(struct gendisk *disk) in revalidate_disk() argument
1167 if (disk->fops->revalidate_disk) in revalidate_disk()
1168 ret = disk->fops->revalidate_disk(disk); in revalidate_disk()
1169 bdev = bdget_disk(disk, 0); in revalidate_disk()
1174 check_disk_size_change(disk, bdev); in revalidate_disk()
1193 struct gendisk *disk = bdev->bd_disk; in check_disk_change() local
1194 const struct block_device_operations *bdops = disk->fops; in check_disk_change()
1197 events = disk_clear_events(disk, DISK_EVENT_MEDIA_CHANGE | in check_disk_change()
1238 struct gendisk *disk; in __blkdev_get() local
1262 disk = get_gendisk(bdev->bd_dev, &partno); in __blkdev_get()
1263 if (!disk) in __blkdev_get()
1265 owner = disk->fops->owner; in __blkdev_get()
1267 disk_block_events(disk); in __blkdev_get()
1270 bdev->bd_disk = disk; in __blkdev_get()
1271 bdev->bd_queue = disk->queue; in __blkdev_get()
1276 bdev->bd_part = disk_get_part(disk, partno); in __blkdev_get()
1281 if (disk->fops->open) { in __blkdev_get()
1282 ret = disk->fops->open(bdev, mode); in __blkdev_get()
1293 disk_unblock_events(disk); in __blkdev_get()
1294 put_disk(disk); in __blkdev_get()
1301 bd_set_size(bdev,(loff_t)get_capacity(disk)<<9); in __blkdev_get()
1311 rescan_partitions(disk, bdev); in __blkdev_get()
1313 invalidate_partitions(disk, bdev); in __blkdev_get()
1320 whole = bdget_disk(disk, 0); in __blkdev_get()
1329 bdev->bd_part = disk_get_part(disk, partno); in __blkdev_get()
1330 if (!(disk->flags & GENHD_FL_UP) || in __blkdev_get()
1353 put_disk(disk); in __blkdev_get()
1360 disk_unblock_events(disk); in __blkdev_get()
1373 disk_unblock_events(disk); in __blkdev_get()
1374 put_disk(disk); in __blkdev_get()
1419 struct gendisk *disk = whole->bd_disk; in blkdev_get() local
1454 (disk->flags & GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE)) { in blkdev_get()
1456 disk_block_events(disk); in blkdev_get()
1576 struct gendisk *disk = bdev->bd_disk; in __blkdev_put() local
1597 if (disk->fops->release) in __blkdev_put()
1598 disk->fops->release(disk, mode); in __blkdev_put()
1601 struct module *owner = disk->fops->owner; in __blkdev_put()
1610 put_disk(disk); in __blkdev_put()