[PATCH v3 10/15] block: introduce blkdev_report_zones_cached()
Chaitanya Kulkarni
chaitanyak at nvidia.com
Mon Nov 3 20:11:44 PST 2025
On 11/3/25 17:31, Damien Le Moal wrote:
> Introduce the function blkdev_report_zones_cached() to provide a fast
> report zone built using the blkdev_get_zone_info() function, which gets
> zone information from a disk zones_cond array or zone write plugs.
> For a large capacity SMR drive, such fast report zone can be completed
> in a few milliseconds compared to several seconds completion times
> when the report zone is obtained from the device.
>
> The zone report is built in the same manner as with the regular
> blkdev_report_zones() function, that is, the first zone reported is the
> one containing the specified start sector and the report is limited to
> the specified number of zones (nr_zones argument). The information for
> each zone in the report is obtained using blkdev_get_zone_info().
>
> For zoned devices that do not use zone write plug resources,
> using blkdev_get_zone_info() is inefficient as the zone report would
> be very slow, generated one zone at a time. To avoid this,
> blkdev_report_zones_cached() falls back to calling
> blkdev_do_report_zones() to execute a regular zone report. In this case,
> the .report_active field of struct blk_report_zones_args is set to true
> to report zone conditions using the BLK_ZONE_COND_ACTIVE condition in
> place of the implicit open, explicit open and closed conditions.
>
> Signed-off-by: Damien Le Moal<dlemoal at kernel.org>
> Reviewed-by: Christoph Hellwig<hch at lst.de>
Looks good.
Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>
-ck
More information about the Linux-nvme
mailing list