md/raid1: factor out choose_bb_rdev() from read_balance()
authorYu Kuai <yukuai3@huawei.com>
Thu, 29 Feb 2024 09:57:12 +0000 (17:57 +0800)
committerSong Liu <song@kernel.org>
Fri, 1 Mar 2024 06:49:46 +0000 (22:49 -0800)
commit9f3ced792203891b8fa39afa37908eba843fcfac
tree15da7f689f0e11357125075c5586d792894f0c18
parentdfa8ecd167c1753d4fc24a517e1d79c603183c94
md/raid1: factor out choose_bb_rdev() from read_balance()

read_balance() is hard to understand because there are too many status
and branches, and it's overlong.

This patch factor out the case to read the rdev with bad blocks from
read_balance(), there are no functional changes.

Co-developed-by: Paul Luse <paul.e.luse@linux.intel.com>
Signed-off-by: Paul Luse <paul.e.luse@linux.intel.com>
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20240229095714.926789-10-yukuai1@huaweicloud.com
drivers/md/raid1.c