[dm-devel] [PATCH v3 10/11] block: add a report_zones method

Hannes Reinecke hare at suse.de
Fri Oct 12 07:42:58 UTC 2018


On 10/12/18 4:30 AM, Damien Le Moal wrote:
> From: Christoph Hellwig <hch at lst.de>
> 
> 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.
> 
> Signed-off-by: Christoph Hellwig <hch at 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.
> Signed-off-by: Damien Le Moal <damien.lemoal at wdc.com>
> ---
>   block/blk-core.c               |   1 -
>   block/blk-mq-debugfs.c         |   1 -
>   block/blk-zoned.c              | 164 ++++++++++----------------------
>   drivers/block/null_blk.h       |  11 ++-
>   drivers/block/null_blk_main.c  |  23 +----
>   drivers/block/null_blk_zoned.c |  57 +++--------
>   drivers/md/dm-flakey.c         |  30 ++++--
>   drivers/md/dm-linear.c         |  35 ++++---
>   drivers/md/dm.c                | 169 ++++++++++++++++-----------------
>   drivers/scsi/sd.c              |  13 +--
>   drivers/scsi/sd.h              |  11 +--
>   drivers/scsi/sd_zbc.c          | 153 +++++++++--------------------
>   include/linux/blk_types.h      |   2 -
>   include/linux/blkdev.h         |   8 +-
>   include/linux/device-mapper.h  |  12 ++-
>   include/trace/events/f2fs.h    |   1 -
>   16 files changed, 266 insertions(+), 425 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare at suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare at suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)




More information about the dm-devel mailing list