[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aKxApo1u8j-ZNOaI@infradead.org>
Date: Mon, 25 Aug 2025 03:53:26 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Yu Kuai <yukuai1@...weicloud.com>
Cc: hch@...radead.org, colyli@...nel.org, hare@...e.de, tieren@...as.com,
axboe@...nel.dk, tj@...nel.org, josef@...icpanda.com,
song@...nel.org, yukuai3@...wei.com, akpm@...ux-foundation.org,
neil@...wn.name, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, cgroups@...r.kernel.org,
linux-raid@...r.kernel.org, yi.zhang@...wei.com,
yangerkun@...wei.com, johnny.chenyi@...wei.com
Subject: Re: [PATCH RFC 1/7] block: export helper bio_submit_split()
On Mon, Aug 25, 2025 at 05:36:54PM +0800, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@...wei.com>
>
> 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?
> +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.
Powered by blists - more mailing lists