virtio-mem: simplify high-level unplug handling in Big Block Mode
authorDavid Hildenbrand <david@redhat.com>
Wed, 2 Jun 2021 18:57:19 +0000 (20:57 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 8 Jul 2021 11:49:02 +0000 (07:49 -0400)
commitc6bc1422fa55033c1bd04c788203af8be2d5ce4c
treed37614f490d0bc3d6cde2f727eff4b0bdde4b48d
parentc740bb97cc84b88f160f32e0b5c80159e1c6fd9c
virtio-mem: simplify high-level unplug handling in Big Block Mode

Let's simplify high-level big block selection when unplugging in
Big Block Mode.

Combine handling of offline and online blocks. We can get rid of
virtio_mem_bbm_bb_is_offline() and simply use
virtio_mem_bbm_offline_remove_and_unplug_bb(), as that already tolerates
offline parts.

We can race with concurrent onlining/offlining either way, so we don;t
have to be super correct by failing if an offline big block we'd like to
unplug just got (partially) onlined.

Signed-off-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/r/20210602185720.31821-7-david@redhat.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_mem.c