On Sun, Aug 10, 2025 at 04:31:12PM +0200, Christoph Hellwig wrote: > On Wed, Aug 06, 2025 at 09:44:47AM -0600, Keith Busch wrote: > > > > Maybe, but I don't have anywhere else to put this. We split the bio to > > its hardware limits at some point, which is where this field gets > > initially set. > > What we do for nr_segs is to just do it on stack while splitting, > and then only record it in the request. I think you could do the same > here, i.e. replace the nr_segs output parameter to __bio_split_to_limits > and it's helpers with a new struct bio_split_info that in the first > version just contains nr_segs, but can be extended to other easily > derived information like the page gaps. I initially tried to copy the nsegs usage in the request, but there are multiple places (iomap, xfs, and btrfs) that split to hardware limits without a request, so I'm not sure where the result is supposed to go to be referenced later. Or do those all call the same split function later in the generic block layer, in which case it shouldn't matter if the upper layers already called it?