Hi,
在 2025/08/25 18:53, Christoph Hellwig 写道:
On Mon, Aug 25, 2025 at 05:36:54PM +0800, Yu Kuai wrote:
From: Yu Kuai <yukuai3@xxxxxxxxxx>
No functional changes are intended, some drivers like mdraid will split
bio by internal processing, prepare to unify bio split codes.
Maybe name the exported helper bio_submit_split_bioset and keep
bio_submit_split() as a wrapper that passes the default split
bioset to keep the code a bit tidyer in blk-merge.c?
Sure.
+struct bio *bio_submit_split(struct bio *bio, int split_sectors,
+ struct bio_set *bs)
{
+ struct bio *split;
+
if (unlikely(split_sectors < 0))
goto error;
- if (split_sectors) {
- struct bio *split;
+ if (!split_sectors)
+ return bio;
- split = bio_split(bio, split_sectors, GFP_NOIO,
- &bio->bi_bdev->bd_disk->bio_split);
- if (IS_ERR(split)) {
- split_sectors = PTR_ERR(split);
- goto error;
- }
- split->bi_opf |= REQ_NOMERGE;
- blkcg_bio_issue_init(split);
- bio_chain(split, bio);
- trace_block_split(split, bio->bi_iter.bi_sector);
- WARN_ON_ONCE(bio_zone_write_plugging(bio));
- submit_bio_noacct(bio);
Maybe skip the reformatting which makes this much harder to read?
If you think it is useful it can be done in a separate patch.
Please ignore this, I'll skip this.
Thanks for the review!
Kuai
.