[PATCH v5 16/28] null_blk: Introduce zone_append_max_sectors attribute

Bart Van Assche bvanassche at acm.org
Thu Apr 4 12:19:34 PDT 2024


On 4/3/24 01:42, Damien Le Moal wrote:
> +	zone_append_max_bytes =
> +		ALIGN_DOWN(dev->zone_append_max_sectors << SECTOR_SHIFT,
> +			   dev->blocksize);
> +	dev->zone_append_max_sectors =
> +		min(zone_append_max_bytes >> SECTOR_SHIFT, zone_capacity_sects);

I think the above code can be simplified to the following:

dev->zone_append_max_sectors =
         min(ALIGN_DOWN(dev->zone_append_max_sectors,
                        dev->blocksize >> SECTOR_SHIFT),
             zone_capacity_sects);

Anyway:

Reviewed-by: Bart Van Assche <bvanassche at acm.org>



More information about the Linux-nvme mailing list