Lines Matching refs:disk

24 	struct gendisk *disk = md->disk;  in dm_blk_do_report_zones()  local
45 args.next_sector < get_capacity(disk)); in dm_blk_do_report_zones()
55 int dm_blk_report_zones(struct gendisk *disk, sector_t sector, in dm_blk_report_zones() argument
58 struct mapped_device *md = disk->private_data; in dm_blk_report_zones()
142 if (md->disk) { in dm_cleanup_zoned_dev()
143 kfree(md->disk->conv_zones_bitmap); in dm_cleanup_zoned_dev()
144 md->disk->conv_zones_bitmap = NULL; in dm_cleanup_zoned_dev()
145 kfree(md->disk->seq_zones_wlock); in dm_cleanup_zoned_dev()
146 md->disk->seq_zones_wlock = NULL; in dm_cleanup_zoned_dev()
180 struct gendisk *disk = md->disk; in dm_zone_revalidate_cb() local
184 if (!disk->conv_zones_bitmap) { in dm_zone_revalidate_cb()
185 disk->conv_zones_bitmap = in dm_zone_revalidate_cb()
186 kcalloc(BITS_TO_LONGS(disk->nr_zones), in dm_zone_revalidate_cb()
188 if (!disk->conv_zones_bitmap) in dm_zone_revalidate_cb()
191 set_bit(idx, disk->conv_zones_bitmap); in dm_zone_revalidate_cb()
195 if (!disk->seq_zones_wlock) { in dm_zone_revalidate_cb()
196 disk->seq_zones_wlock = in dm_zone_revalidate_cb()
197 kcalloc(BITS_TO_LONGS(disk->nr_zones), in dm_zone_revalidate_cb()
199 if (!disk->seq_zones_wlock) in dm_zone_revalidate_cb()
204 kvcalloc(disk->nr_zones, sizeof(unsigned int), in dm_zone_revalidate_cb()
229 struct gendisk *disk = md->disk; in dm_revalidate_zones() local
237 if (!disk->nr_zones || disk->nr_zones != md->nr_zones) in dm_revalidate_zones()
247 ret = dm_blk_do_report_zones(md, t, 0, disk->nr_zones, in dm_revalidate_zones()
252 if (ret != disk->nr_zones) { in dm_revalidate_zones()
257 md->nr_zones = disk->nr_zones; in dm_revalidate_zones()
299 md->disk->nr_zones = bdev_nr_zones(md->disk->part0); in dm_set_zones_restrictions()
313 if (!get_capacity(md->disk)) in dm_set_zones_restrictions()
332 sector_t sector = zno * bdev_zone_sectors(md->disk->part0); in dm_update_zone_wp_offset()
371 sector_t zsectors = bdev_zone_sectors(md->disk->part0); in dm_zone_map_bio_begin()
441 bdev_zone_sectors(md->disk->part0)); in dm_zone_map_bio_end()
464 static inline void dm_zone_lock(struct gendisk *disk, unsigned int zno, in dm_zone_lock() argument
470 wait_on_bit_lock_io(disk->seq_zones_wlock, zno, TASK_UNINTERRUPTIBLE); in dm_zone_lock()
474 static inline void dm_zone_unlock(struct gendisk *disk, unsigned int zno, in dm_zone_unlock() argument
480 WARN_ON_ONCE(!test_bit(zno, disk->seq_zones_wlock)); in dm_zone_unlock()
481 clear_bit_unlock(zno, disk->seq_zones_wlock); in dm_zone_unlock()
483 wake_up_bit(disk->seq_zones_wlock, zno); in dm_zone_unlock()
533 dm_zone_lock(md->disk, zno, clone); in dm_zone_map_bio()
543 dm_zone_unlock(md->disk, zno, clone); in dm_zone_map_bio()
567 dm_zone_unlock(md->disk, zno, clone); in dm_zone_map_bio()
572 dm_zone_unlock(md->disk, zno, clone); in dm_zone_map_bio()
589 struct gendisk *disk = md->disk; in dm_zone_endio() local
606 (sector_t)bdev_zone_sectors(disk->part0) - 1; in dm_zone_endio()
647 dm_zone_unlock(disk, zno, clone); in dm_zone_endio()