[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b128ed58-97d8-b3b2-f86f-6f50efd98db8@huaweicloud.com>
Date: Tue, 26 Aug 2025 08:51:37 +0800
From: Yu Kuai <yukuai1@...weicloud.com>
To: Christoph Hellwig <hch@...radead.org>, Yu Kuai <yukuai1@...weicloud.com>
Cc: colyli@...nel.org, hare@...e.de, tieren@...as.com, axboe@...nel.dk,
tj@...nel.org, josef@...icpanda.com, song@...nel.org,
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, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH RFC 1/7] block: export helper bio_submit_split()
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@...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?
>
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
> .
>
Powered by blists - more mailing lists