md/raid1-10: factor out a helper to add bio to plug

[ Upstream commit 5ec6ca140a ]

The code in raid1 and raid10 is identical, prepare to limit the number
of plugged bios.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20230529131106.2123367-3-yukuai1@huaweicloud.com
Stable-dep-of: 7db922bae3 ("md/raid1-10: submit write io directly if bitmap is not enabled")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Yu Kuai 2023-05-29 21:11:01 +08:00 • committed by Greg Kroah-Hartman
commit b2ac26d298
3 changed files with 18 additions and 21 deletions