mirror of
https://github.com/torvalds/linux.git
synced 2026-01-25 07:47:50 +00:00
md/raid5: 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: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -5486,7 +5486,6 @@ static int raid5_read_one_chunk(struct mddev *mddev, struct bio *raid_bio)
|
||||
|
||||
static struct bio *chunk_aligned_read(struct mddev *mddev, struct bio *raid_bio)
|
||||
{
|
||||
struct bio *split;
|
||||
sector_t sector = raid_bio->bi_iter.bi_sector;
|
||||
unsigned chunk_sects = mddev->chunk_sectors;
|
||||
unsigned sectors = chunk_sects - (sector & (chunk_sects-1));
|
||||
@@ -5494,11 +5493,10 @@ static struct bio *chunk_aligned_read(struct mddev *mddev, struct bio *raid_bio)
|
||||
if (sectors < bio_sectors(raid_bio)) {
|
||||
struct r5conf *conf = mddev->private;
|
||||
|
||||
split = bio_split(raid_bio, sectors, GFP_NOIO, &conf->bio_split);
|
||||
bio_chain(split, raid_bio);
|
||||
trace_block_split(split, raid_bio->bi_iter.bi_sector);
|
||||
submit_bio_noacct(raid_bio);
|
||||
raid_bio = split;
|
||||
raid_bio = bio_submit_split_bioset(raid_bio, sectors,
|
||||
&conf->bio_split);
|
||||
if (!raid_bio)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!raid5_read_one_chunk(mddev, raid_bio))
|
||||
|
||||
Reference in New Issue
Block a user