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

Damien Le Moal
2025-11-03T05:56:45Z

On 11/1/25 05:54, Bart Van Assche wrote:
> 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?'

See patch 8. That structure grows beyond just the callback. So I prefer to keep
the name as it is more generic.

--
Damien Le Moal
Western Digital Research