Lines Matching refs:disk
25 struct gendisk *disk = md->disk; in dm_blk_do_report_zones() local
46 args.next_sector < get_capacity(disk)); in dm_blk_do_report_zones()
56 int dm_blk_report_zones(struct gendisk *disk, sector_t sector, in dm_blk_report_zones() argument
59 struct mapped_device *md = disk->private_data; in dm_blk_report_zones()
143 if (md->disk) { in dm_cleanup_zoned_dev()
144 bitmap_free(md->disk->conv_zones_bitmap); in dm_cleanup_zoned_dev()
145 md->disk->conv_zones_bitmap = NULL; in dm_cleanup_zoned_dev()
146 bitmap_free(md->disk->seq_zones_wlock); in dm_cleanup_zoned_dev()
147 md->disk->seq_zones_wlock = NULL; in dm_cleanup_zoned_dev()
181 struct gendisk *disk = md->disk; in dm_zone_revalidate_cb() local
185 if (!disk->conv_zones_bitmap) { in dm_zone_revalidate_cb()
186 disk->conv_zones_bitmap = bitmap_zalloc(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 = bitmap_zalloc(disk->nr_zones, in dm_zone_revalidate_cb()
198 if (!disk->seq_zones_wlock) in dm_zone_revalidate_cb()
203 kvcalloc(disk->nr_zones, sizeof(unsigned int), in dm_zone_revalidate_cb()
228 struct gendisk *disk = md->disk; in dm_revalidate_zones() local
236 if (!disk->nr_zones || disk->nr_zones != md->nr_zones) in dm_revalidate_zones()
246 ret = dm_blk_do_report_zones(md, t, 0, disk->nr_zones, in dm_revalidate_zones()
251 if (ret != disk->nr_zones) { in dm_revalidate_zones()
256 md->nr_zones = disk->nr_zones; in dm_revalidate_zones()
298 md->disk->nr_zones = bdev_nr_zones(md->disk->part0); in dm_set_zones_restrictions()
312 if (!get_capacity(md->disk)) in dm_set_zones_restrictions()
331 sector_t sector = zno * bdev_zone_sectors(md->disk->part0); in dm_update_zone_wp_offset()
370 sector_t zsectors = bdev_zone_sectors(md->disk->part0); in dm_zone_map_bio_begin()
440 bdev_zone_sectors(md->disk->part0)); in dm_zone_map_bio_end()
463 static inline void dm_zone_lock(struct gendisk *disk, unsigned int zno, in dm_zone_lock() argument
469 wait_on_bit_lock_io(disk->seq_zones_wlock, zno, TASK_UNINTERRUPTIBLE); in dm_zone_lock()
473 static inline void dm_zone_unlock(struct gendisk *disk, unsigned int zno, in dm_zone_unlock() argument
479 WARN_ON_ONCE(!test_bit(zno, disk->seq_zones_wlock)); in dm_zone_unlock()
480 clear_bit_unlock(zno, disk->seq_zones_wlock); in dm_zone_unlock()
482 wake_up_bit(disk->seq_zones_wlock, zno); in dm_zone_unlock()
532 dm_zone_lock(md->disk, zno, clone); in dm_zone_map_bio()
542 dm_zone_unlock(md->disk, zno, clone); in dm_zone_map_bio()
566 dm_zone_unlock(md->disk, zno, clone); in dm_zone_map_bio()
571 dm_zone_unlock(md->disk, zno, clone); in dm_zone_map_bio()
588 struct gendisk *disk = md->disk; in dm_zone_endio() local
605 (sector_t)bdev_zone_sectors(disk->part0) - 1; in dm_zone_endio()
646 dm_zone_unlock(disk, zno, clone); in dm_zone_endio()