Lines Matching refs:bdev

147 int blkdev_report_zones(struct block_device *bdev, sector_t sector,  in blkdev_report_zones()  argument
150 struct gendisk *disk = bdev->bd_disk; in blkdev_report_zones()
153 if (!blk_queue_is_zoned(bdev_get_queue(bdev)) || in blkdev_report_zones()
190 static int blkdev_zone_reset_all_emulated(struct block_device *bdev, in blkdev_zone_reset_all_emulated() argument
193 struct request_queue *q = bdev_get_queue(bdev); in blkdev_zone_reset_all_emulated()
194 sector_t capacity = get_capacity(bdev->bd_disk); in blkdev_zone_reset_all_emulated()
205 ret = bdev->bd_disk->fops->report_zones(bdev->bd_disk, 0, in blkdev_zone_reset_all_emulated()
219 bio_set_dev(bio, bdev); in blkdev_zone_reset_all_emulated()
238 static int blkdev_zone_reset_all(struct block_device *bdev, gfp_t gfp_mask) in blkdev_zone_reset_all() argument
243 bio_set_dev(&bio, bdev); in blkdev_zone_reset_all()
265 int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op, in blkdev_zone_mgmt() argument
269 struct request_queue *q = bdev_get_queue(bdev); in blkdev_zone_mgmt()
271 sector_t capacity = get_capacity(bdev->bd_disk); in blkdev_zone_mgmt()
279 if (bdev_read_only(bdev)) in blkdev_zone_mgmt()
304 return blkdev_zone_reset_all_emulated(bdev, gfp_mask); in blkdev_zone_mgmt()
305 return blkdev_zone_reset_all(bdev, gfp_mask); in blkdev_zone_mgmt()
310 bio_set_dev(bio, bdev); in blkdev_zone_mgmt()
344 int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode, in blkdev_report_zones_ioctl() argument
356 q = bdev_get_queue(bdev); in blkdev_report_zones_ioctl()
370 ret = blkdev_report_zones(bdev, rep.sector, rep.nr_zones, in blkdev_report_zones_ioctl()
382 static int blkdev_truncate_zone_range(struct block_device *bdev, fmode_t mode, in blkdev_truncate_zone_range() argument
388 zrange->sector + zrange->nr_sectors > get_capacity(bdev->bd_disk)) in blkdev_truncate_zone_range()
395 return truncate_bdev_range(bdev, mode, start, end); in blkdev_truncate_zone_range()
402 int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode, in blkdev_zone_mgmt_ioctl() argument
414 q = bdev_get_queue(bdev); in blkdev_zone_mgmt_ioctl()
432 filemap_invalidate_lock(bdev->bd_inode->i_mapping); in blkdev_zone_mgmt_ioctl()
433 ret = blkdev_truncate_zone_range(bdev, mode, &zrange); in blkdev_zone_mgmt_ioctl()
450 ret = blkdev_zone_mgmt(bdev, op, zrange.sector, zrange.nr_sectors, in blkdev_zone_mgmt_ioctl()
455 filemap_invalidate_unlock(bdev->bd_inode->i_mapping); in blkdev_zone_mgmt_ioctl()