Re: [PATCH v2 3/4] block: factor out path limit stacking

Christoph Hellwig <[email protected]>
Newsgroups org.kernel.vger.linux-block,org.infradead.lists.linux-nvme
Message-ID <[email protected]>
On Thu, Aug 06, 2026 at 10:46:57AM +0800, Yao Sang wrote:
> +static void blk_stack_path_limits(struct queue_limits *t,
> +		const struct queue_limits *b)

I find the path limits name a bit confusing, but I don't really
have a much better suggestion.

> +	t->max_dev_sectors = min_not_zero(t->max_dev_sectors, b->max_dev_sectors);

overly long line here.

I wonder if we sould have a helper macro that encapsulates the

	t = min_not_zero(t, b)

pattern to make all these lines a bit easier to read while we're
at it?

>  	t->max_sectors = min_not_zero(t->max_sectors, b->max_sectors);
>  	t->max_user_sectors = min_not_zero(t->max_user_sectors,
>  			b->max_user_sectors);
> -	t->max_hw_sectors = min_not_zero(t->max_hw_sectors, b->max_hw_sectors);
> -	t->max_dev_sectors = min_not_zero(t->max_dev_sectors, b->max_dev_sectors);
>  	t->max_write_zeroes_sectors = min(t->max_write_zeroes_sectors,
>  					b->max_write_zeroes_sectors);
>  	t->max_user_wzeroes_unmap_sectors =

I'm also not sure why some limits are included in the path limits
and other not.  E.g. wy not max_write_zeroes_sectors?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.