blk-crypto: convert to use bio_submit_split_bioset()

JIRA: https://issues.redhat.com/browse/RHEL-154215

commit e3290419d9be6cbd7a42c0691504dd66825cabf5
Author: Yu Kuai <yukuai3@huawei.com>
Date:   Wed Sep 10 14:30:53 2025 +0800

    blk-crypto: convert to use bio_submit_split_bioset()

    Unify bio split code, prepare to fix ordering of split IO.

    Signed-off-by: Yu Kuai <yukuai3@huawei.com>
    Reviewed-by: Bart Van Assche <bvanassche@acm.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Ming Lei <ming.lei@redhat.com>
This commit is contained in:
Ming Lei
2026-03-10 16:32:38 +08:00
parent 3c0fbc51b1
commit 843e35328d
+5 -12
View File
@@ -18,7 +18,6 @@
#include <linux/module.h>
#include <linux/random.h>
#include <linux/scatterlist.h>
#include <trace/events/block.h>
#include "blk-cgroup.h"
#include "blk-crypto-internal.h"
@@ -223,20 +222,14 @@ static bool blk_crypto_fallback_split_bio_if_needed(struct bio **bio_ptr)
if (++i == BIO_MAX_VECS)
break;
}
if (num_sectors < bio_sectors(bio)) {
struct bio *split_bio;
split_bio = bio_split(bio, num_sectors, GFP_NOIO,
&crypto_bio_split);
if (IS_ERR(split_bio)) {
bio->bi_status = BLK_STS_RESOURCE;
bio = bio_submit_split_bioset(bio, num_sectors,
&crypto_bio_split);
if (!bio)
return false;
}
bio_chain(split_bio, bio);
trace_block_split(split_bio, bio->bi_iter.bi_sector);
submit_bio_noacct(bio);
*bio_ptr = split_bio;
*bio_ptr = bio;
}
return true;