dm vdo data-vio: silence sparse warnings about locking context imbalances
authorMike Snitzer <snitzer@kernel.org>
Tue, 6 Feb 2024 02:04:19 +0000 (21:04 -0500)
committerMike Snitzer <snitzer@kernel.org>
Tue, 20 Feb 2024 18:43:18 +0000 (13:43 -0500)
commit872564c501b72ae0c84af51084753e8652e4a84b
treecbd175a50bc33d9602e2e250f59e397930d0b7a4
parenta6c05c981ecc841a3e95af666c2a1a6a265e7adc
dm vdo data-vio: silence sparse warnings about locking context imbalances

Factor wait_permit() out from acquire_permit() so that the latter
always holds the spinlock and the former always releases it.

Otherwise sparse complains about locking context imbalances due to
conditional spin_unlock in acquire_permit:
 warning: context imbalance in 'acquire_permit' - different lock contexts for basic block
 warning: context imbalance in 'vdo_launch_bio' - unexpected unlock

Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Susan LeGendre-McGhee <slegendr@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
drivers/md/dm-vdo/data-vio.c