Lines Matching full:disk
1094 struct gendisk *disk = get_gendisk(bdev->bd_dev, partno); in bdev_get_gendisk() local
1096 if (!disk) in bdev_get_gendisk()
1107 put_disk_and_module(disk); in bdev_get_gendisk()
1110 return disk; in bdev_get_gendisk()
1170 struct gendisk *disk; member
1175 struct gendisk *disk) in bd_find_holder_disk() argument
1180 if (holder->disk == disk) in bd_find_holder_disk()
1196 * bd_link_disk_holder - create symlinks between holding disk and slave bdev
1198 * @disk: the holding disk
1204 * - from "slaves" directory of the holder @disk to the claimed @bdev
1205 * - from "holders" directory of the @bdev to the holder @disk
1207 * For example, if /dev/dm-0 maps to /dev/sda and disk for dm-0 is
1214 * ensure that both @bdev and @disk are valid during the creation and
1223 int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) in bd_link_disk_holder() argument
1233 if (WARN_ON(!disk->slave_dir || !bdev->bd_part->holder_dir)) in bd_link_disk_holder()
1236 holder = bd_find_holder_disk(bdev, disk); in bd_link_disk_holder()
1249 holder->disk = disk; in bd_link_disk_holder()
1252 ret = add_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); in bd_link_disk_holder()
1256 ret = add_symlink(bdev->bd_part->holder_dir, &disk_to_dev(disk)->kobj); in bd_link_disk_holder()
1269 del_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); in bd_link_disk_holder()
1281 * @disk: the holding disk
1288 void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk) in bd_unlink_disk_holder() argument
1294 holder = bd_find_holder_disk(bdev, disk); in bd_unlink_disk_holder()
1297 del_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); in bd_unlink_disk_holder()
1299 &disk_to_dev(disk)->kobj); in bd_unlink_disk_holder()
1311 * check_disk_size_change - checks for disk size change and adjusts bdev size.
1312 * @disk: struct gendisk to check
1316 * This routine checks to see if the bdev size does not match the disk size
1320 static void check_disk_size_change(struct gendisk *disk, in check_disk_size_change() argument
1326 disk_size = (loff_t)get_capacity(disk) << 9; in check_disk_size_change()
1332 disk->disk_name, bdev_size, disk_size); in check_disk_size_change()
1340 pr_warn("VFS: busy inodes on resized disk %s\n", in check_disk_size_change()
1341 disk->disk_name); in check_disk_size_change()
1346 * revalidate_disk_size - checks for disk size change and adjusts bdev size.
1347 * @disk: struct gendisk to check
1350 * This routine checks to see if the bdev size does not match the disk size
1354 void revalidate_disk_size(struct gendisk *disk, bool verbose) in revalidate_disk_size() argument
1362 if (disk->flags & GENHD_FL_HIDDEN) in revalidate_disk_size()
1365 bdev = bdget_disk(disk, 0); in revalidate_disk_size()
1367 check_disk_size_change(disk, bdev, verbose); in revalidate_disk_size()
1385 struct gendisk *disk = bdev->bd_disk; in bdev_disk_changed() local
1406 if (disk_part_scan_enabled(disk) || in bdev_disk_changed()
1407 !(disk->flags & GENHD_FL_REMOVABLE)) in bdev_disk_changed()
1408 set_capacity(disk, 0); in bdev_disk_changed()
1410 if (disk->fops->revalidate_disk) in bdev_disk_changed()
1411 disk->fops->revalidate_disk(disk); in bdev_disk_changed()
1414 check_disk_size_change(disk, bdev, !invalidate); in bdev_disk_changed()
1416 if (get_capacity(disk)) { in bdev_disk_changed()
1417 ret = blk_add_partitions(disk, bdev); in bdev_disk_changed()
1425 kobject_uevent(&disk_to_dev(disk)->kobj, KOBJ_CHANGE); in bdev_disk_changed()
1447 struct gendisk *disk; in __blkdev_get() local
1455 disk = bdev_get_gendisk(bdev, &partno); in __blkdev_get()
1456 if (!disk) in __blkdev_get()
1460 whole = bdget_disk(disk, 0); in __blkdev_get()
1478 disk_block_events(disk); in __blkdev_get()
1482 bdev->bd_disk = disk; in __blkdev_get()
1488 bdev->bd_part = disk_get_part(disk, partno); in __blkdev_get()
1493 if (disk->fops->open) { in __blkdev_get()
1494 ret = disk->fops->open(bdev, mode); in __blkdev_get()
1496 * If we lost a race with 'disk' being deleted, in __blkdev_get()
1504 bd_set_nr_sectors(bdev, get_capacity(disk)); in __blkdev_get()
1514 if (test_bit(GD_NEED_PART_SCAN, &disk->state) && in __blkdev_get()
1526 bdev->bd_part = disk_get_part(disk, partno); in __blkdev_get()
1527 if (!(disk->flags & GENHD_FL_UP) || in __blkdev_get()
1537 bdev->bd_bdi = bdi_get(disk->queue->backing_dev_info); in __blkdev_get()
1544 if (test_bit(GD_NEED_PART_SCAN, &disk->state) && in __blkdev_get()
1564 (disk->flags & GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE)) { in __blkdev_get()
1571 disk_unblock_events(disk); in __blkdev_get()
1573 /* only one opener holds refs to the module and disk */ in __blkdev_get()
1575 put_disk_and_module(disk); in __blkdev_get()
1591 disk_unblock_events(disk); in __blkdev_get()
1596 put_disk_and_module(disk); in __blkdev_get()
1756 struct gendisk *disk = bdev->bd_disk; in __blkdev_put() local
1781 if (disk->fops->release) in __blkdev_put()
1782 disk->fops->release(disk, mode); in __blkdev_put()
1792 put_disk_and_module(disk); in __blkdev_put()