> +struct blk_zoned {
> +     unsigned int    nr_zones;
> +     unsigned long   *seq_zones;
> +};
> +
>  struct blk_zone_report_hdr {
>       unsigned int    nr_zones;
>       u8              padding[60];
> @@ -492,6 +497,10 @@ struct request_queue {
>       struct blk_integrity integrity;
>  #endif       /* CONFIG_BLK_DEV_INTEGRITY */
>  
> +#ifdef CONFIG_BLK_DEV_ZONED
> +     struct blk_zoned        zoned;
> +#endif

I'd prefer to just add the two fields direct to struct request_queue
instead of the container structure.

> +static inline unsigned int blk_queue_nr_zones(struct request_queue *q)
> +{
> +     return blk_queue_is_zoned(q) ? q->zoned.nr_zones : 0;
> +}

I don't think this is going to compile without CONFIG_BLK_DEV_ZONED,
we'd either need two versions of it, or just always add nr_zones to
the request queue.

With nr_zones always present we could then remove the first check,
too as it would always be initialized to zero.

Reply via email to