The various "tick" functions will only be called after CHECKER_FINISHED
is reached. So we might as well move them into the respective code block
into checker_finished(). This way don't have to drop and re-take he lock
when all paths have been checked.

Signed-off-by: Martin Wilck <mwi...@suse.com>
---
 multipathd/main.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index 354fadf..7e844a5 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -2990,6 +2990,11 @@ static void checker_finished(struct vectors *vecs)
                        /* multipath device deleted */
                        i--;
        }
+       deferred_failback_tick(vecs);
+       retry_count_tick(vecs->mpvec);
+       missing_uev_wait_tick(vecs);
+       ghost_delay_tick(vecs);
+       partial_retrigger_tick(vecs->pathvec);
 }
 
 static void *
@@ -3069,16 +3074,6 @@ checkerloop (void *ap)
                        lock_cleanup_pop(vecs->lock);
                }
 
-               pthread_cleanup_push(cleanup_lock, &vecs->lock);
-               lock(&vecs->lock);
-               pthread_testcancel();
-               deferred_failback_tick(vecs);
-               retry_count_tick(vecs->mpvec);
-               missing_uev_wait_tick(vecs);
-               ghost_delay_tick(vecs);
-               partial_retrigger_tick(vecs->pathvec);
-               lock_cleanup_pop(vecs->lock);
-
                if (count)
                        count--;
                else {
-- 
2.47.0


Reply via email to