]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
block: introduce disk_report_zone()
authorDamien Le Moal <dlemoal@kernel.org>
Tue, 4 Nov 2025 21:22:38 +0000 (06:22 +0900)
committerJens Axboe <axboe@kernel.dk>
Wed, 5 Nov 2025 15:07:21 +0000 (08:07 -0700)
commitfdb9aed869f34d776298b3a8197909eb820e4d0d
tree2bff9d86dd0d23f9ff43822134dfd4efc6d0345a
parente8ecb21f081fe0cab33dc20cbe65ccbbfe615c15
block: introduce disk_report_zone()

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@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
16 files changed:
block/blk-zoned.c
drivers/block/null_blk/null_blk.h
drivers/block/null_blk/zoned.c
drivers/block/ublk_drv.c
drivers/block/virtio_blk.c
drivers/block/zloop.c
drivers/md/dm-zone.c
drivers/md/dm.h
drivers/nvme/host/core.c
drivers/nvme/host/multipath.c
drivers/nvme/host/nvme.h
drivers/nvme/host/zns.c
drivers/scsi/sd.h
drivers/scsi/sd_zbc.c
include/linux/blkdev.h
include/linux/device-mapper.h