[PATCH v3 04/15] block: introduce disk_report_zone()

Hannes Reinecke hare at suse.de
Tue Nov 4 11:39:34 PST 2025


On 11/4/25 02:31, Damien Le Moal wrote:
> Commit b76b840fd933 ("dm: Fix dm-zoned-reclaim zone write pointer
> alignment") introduced an indirect call for the callback function of a
> report zones executed with blkdev_report_zones(). This is necessary so
> that the function disk_zone_wplug_sync_wp_offset() can be called to
> refresh a zone write plug zone write pointer offset after a write error.
> However, this solution makes following the path of a zone information
> harder to understand.
> 
> Clean this up by introducing the new blk_report_zones_args structure to
> define a zone report callback and its private data and introduce the
> helper function disk_report_zone() which calls both
> disk_zone_wplug_sync_wp_offset() and the zone report user callback
> function for all zones of a zone report. This helper function must be
> called by all block device drivers that implement the report zones
> block operation in order to correctly report a zone information.
> 
> All block device drivers supporting the report_zones block operation are
> updated to use this new scheme.
> 
> Signed-off-by: Damien Le Moal <dlemoal at kernel.org>
> Reviewed-by: Christoph Hellwig <hch at lst.de>
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn at wdc.com>
> ---
>   block/blk-zoned.c                 | 79 ++++++++++++++++---------------
>   drivers/block/null_blk/null_blk.h |  3 +-
>   drivers/block/null_blk/zoned.c    |  4 +-
>   drivers/block/ublk_drv.c          |  4 +-
>   drivers/block/virtio_blk.c        | 11 +++--
>   drivers/block/zloop.c             |  4 +-
>   drivers/md/dm-zone.c              | 54 +++++++++++----------
>   drivers/md/dm.h                   |  3 +-
>   drivers/nvme/host/core.c          |  5 +-
>   drivers/nvme/host/multipath.c     |  4 +-
>   drivers/nvme/host/nvme.h          |  2 +-
>   drivers/nvme/host/zns.c           | 10 ++--
>   drivers/scsi/sd.h                 |  2 +-
>   drivers/scsi/sd_zbc.c             | 20 +++-----
>   include/linux/blkdev.h            |  7 ++-
>   include/linux/device-mapper.h     | 10 +++-
>   16 files changed, 120 insertions(+), 102 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare at suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare at suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich



More information about the Linux-nvme mailing list