md/raid10: improve discard request for far layout
authorXiao Ni <xni@redhat.com>
Wed, 2 Sep 2020 12:00:23 +0000 (20:00 +0800)
committerSong Liu <songliubraving@fb.com>
Thu, 24 Sep 2020 23:44:45 +0000 (16:44 -0700)
commitd3ee2d8415a6256c1c41e1be36e80e640c3e6359
tree8517646317457beb0a9a3662320686ac46cfea6a
parentbcc90d280465ebd51ab8688be86e1f00c62dccf9
md/raid10: improve discard request for far layout

For far layout, the discard region is not continuous on disks. So it needs
far copies r10bio to cover all regions. It needs a way to know all r10bios
have finish or not. Similar with raid10_sync_request, only the first r10bio
master_bio records the discard bio. Other r10bios master_bio record the
first r10bio. The first r10bio can finish after other r10bios finish and
then return the discard bio.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
drivers/md/raid10.c
drivers/md/raid10.h