@@ -2967,6 +2967,31 @@ update_paths(struct vectors *vecs, int *num_paths_p, time_t start_secs)
return CHECKER_FINISHED;
}
+static void checker_finished(struct vectors *vecs, unsigned int ticks)
+{
+ struct multipath *mpp;
+ int i;
+
+ vector_foreach_slot(vecs->mpvec, mpp, i) {
+ bool inconsistent;
+
+ sync_mpp(vecs, mpp, ticks);
+ inconsistent = mpp->need_reload;
+ if (update_mpp_prio(mpp) || inconsistent)
+ if (reload_and_sync_map(mpp, vecs) == 2) {
+ /* multipath device deleted */
+ i--;
+ continue;
+ }
+ /*
+ * If we reloaded due to inconsistent state,
+ * schedule another sync at the next tick.
+ */
+ if (inconsistent)
+ mpp->sync_tick = 1;
+ }
+}
+
static void *
checkerloop (void *ap)
{
@@ -3034,26 +3059,8 @@ checkerloop (void *ap)
if (checker_state == CHECKER_UPDATING_PATHS)
checker_state = update_paths(vecs, &num_paths,
start_time.tv_sec);
- if (checker_state == CHECKER_FINISHED) {
- vector_foreach_slot(vecs->mpvec, mpp, i) {
- bool inconsistent;
-
- sync_mpp(vecs, mpp, ticks);
- inconsistent = mpp->need_reload;
- if ((update_mpp_prio(mpp) || inconsistent) &&
- reload_and_sync_map(mpp, vecs) == 2) {
- /* multipath device deleted */
- i--;
- continue;
- }
- /*
- * If we reloaded due to inconsistent state,
- * schedule another sync at the next tick.
- */
- if (inconsistent)
- mpp->sync_tick = 1;
- }
- }
+ if (checker_state == CHECKER_FINISHED)
+ checker_finished(vecs, ticks);
lock_cleanup_pop(vecs->lock);
}