md/raid10: convert read/write to use bio_submit_split_bioset()
authorYu Kuai <yukuai3@huawei.com>
Wed, 10 Sep 2025 06:30:50 +0000 (14:30 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 10 Sep 2025 11:23:45 +0000 (05:23 -0600)
commit6fc07785d9b89255bba45fc84475bb32f9737a90
treede93e52e73893db135c0bb27cbdf147256ed1262
parentdeeeab3028afebf2f13428f69dcba9f572f0463b
md/raid10: convert read/write to use bio_submit_split_bioset()

Unify bio split code, prepare to fix ordering of split IO, the error path
is modified a bit, however no functional changes are intended:

- bio_submit_split_bioset() can fail the original bio directly
  by split error, set R10BIO_Uptodate in this case to notify
  raid_end_bio_io() that the original bio is returned already.
- set R10BIO_Uptodate and set error value to -EIO is useless now,
  for r10_bio without R10BIO_Uptodate, -EIO will be returned for
  original bio.

And discard is not handled, because discard is only split for
unaligned head and tail, and this can be considered slow path, the
reorder here does not matter much.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/raid10.c