On Mon, Aug 26, 2024 at 07:37:54PM +0200, Christoph Hellwig wrote: > The current setup with bio_may_exceed_limit and __bio_split_to_limits > is a bit of a mess. > > Change it so that __bio_split_to_limits does all the work and is just > a variant of bio_split_to_limits that returns nr_segs. This is done > by inlining it and instead have the various bio_split_* helpers directly > submit the potentially split bios. > > To support btrfs, the rw version has a lower level helper split out > that just returns the offset to split. This turns out to nicely clean > up the btrfs flow as well. > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > --- > block/blk-merge.c | 146 +++++++++++++++++--------------------------- > block/blk-mq.c | 11 ++-- > block/blk.h | 63 +++++++++++++------ For > fs/btrfs/bio.c | 30 +++++---- Acked-by: David Sterba <dsterba@xxxxxxxx>