[PATCH 04/13] block: introduce disk_report_zone()

Bart Van Assche bvanassche at acm.org
Fri Oct 31 13:54:16 PDT 2025


On 10/30/25 11:12 PM, Damien Le Moal wrote:
> -struct disk_report_zones_cb_args {
> -	struct gendisk	*disk;
> -	report_zones_cb	user_cb;
> -	void		*user_data;
> +/*
> + * Zone report arguments for block device drivers report_zones operation.
> + * @cb: report_zones_cb callback for each reported zone.
> + * @data: Private data passed to report_zones_cb.
> + */
> +struct blk_report_zones_args {
> +	report_zones_cb cb;
> +	void		*data;
>   };

The suffix "_args" seems confusing to me because this data structure
includes a callback pointer. Please consider changing "_args" into "_cb"
to make it clear that the data structure includes a callback pointer.
Another data structure that follows this convention is struct
blk_plug_cb:

   struct blk_plug_cb;
   typedef void (*blk_plug_cb_fn)(struct blk_plug_cb *, bool);
   struct blk_plug_cb {
	struct list_head list;
	blk_plug_cb_fn callback;
	void *data;
   };

Since struct blk_report_zones_args is passed as an argument to
disk_report_zone(), how about renaming this data structure into
struct disk_report_zone_cb?'

Otherwise this patch looks good to me.

Thanks,

Bart.



More information about the Linux-nvme mailing list