block: add a report_zones method
Dispatching a report zones command through the request queue is a major pain due to the command reply payload rewriting necessary. Given that blkdev_report_zones() is executing everything synchronously, implement report zones as a block device file operation instead, allowing major simplification of the code in many places. sd, null-blk, dm-linear and dm-flakey being the only block device drivers supporting exposing zoned block devices, these drivers are modified to provide the device side implementation of the report_zones() block device file operation. For device mappers, a new report_zones() target type operation is defined so that the upper block layer calls blkdev_report_zones() can be propagated down to the underlying devices of the dm targets. Implementation for this new operation is added to the dm-linear and dm-flakey targets. Reviewed-by:Hannes Reinecke <hare@suse.com> Signed-off-by:
Christoph Hellwig <hch@lst.de> [Damien] * Changed method block_device argument to gendisk * Various bug fixes and improvements * Added support for null_blk, dm-linear and dm-flakey. Reviewed-by:
Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by:
Mike Snitzer <snitzer@redhat.com> Signed-off-by:
Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by:
Jens Axboe <axboe@kernel.dk>
Showing
- block/blk-core.c 0 additions, 1 deletionblock/blk-core.c
- block/blk-mq-debugfs.c 0 additions, 1 deletionblock/blk-mq-debugfs.c
- block/blk-zoned.c 51 additions, 113 deletionsblock/blk-zoned.c
- drivers/block/null_blk.h 7 additions, 4 deletionsdrivers/block/null_blk.h
- drivers/block/null_blk_main.c 1 addition, 22 deletionsdrivers/block/null_blk_main.c
- drivers/block/null_blk_zoned.c 15 additions, 42 deletionsdrivers/block/null_blk_zoned.c
- drivers/md/dm-flakey.c 21 additions, 9 deletionsdrivers/md/dm-flakey.c
- drivers/md/dm-linear.c 21 additions, 14 deletionsdrivers/md/dm-linear.c
- drivers/md/dm.c 84 additions, 85 deletionsdrivers/md/dm.c
- drivers/scsi/sd.c 1 addition, 12 deletionsdrivers/scsi/sd.c
- drivers/scsi/sd.h 5 additions, 6 deletionsdrivers/scsi/sd.h
- drivers/scsi/sd_zbc.c 47 additions, 106 deletionsdrivers/scsi/sd_zbc.c
- include/linux/blk_types.h 0 additions, 2 deletionsinclude/linux/blk_types.h
- include/linux/blkdev.h 3 additions, 5 deletionsinclude/linux/blkdev.h
- include/linux/device-mapper.h 10 additions, 2 deletionsinclude/linux/device-mapper.h
- include/trace/events/f2fs.h 0 additions, 1 deletioninclude/trace/events/f2fs.h
Loading
Please register or sign in to comment