repart: Only lock block device once
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 3 Aug 2022 09:37:17 +0000 (11:37 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 4 Aug 2022 00:03:47 +0000 (01:03 +0100)
commit25baae502a9faa1a50d490b42955019d660da374
tree2b3d7b984d06a1b66e9c048b24b8a897c47d5bbd
parent33b7d7b284928bec88015aa2c6ca60e9c9599382
repart: Only lock block device once

Let's lock the backing fd instead of locking/unlocking multiple
times when doing multiple operations with repart. It doesn't make
much sense for anything else to touch the block device while there
are still repart operations pending on it. By keeping the lock over
the full duration of repart, we avoid anything else from interfering
with the block device inbetween operations.
src/partition/repart.c