From a75560529663e5fd055884e32ab9c73f47f8aaa5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 6 Jul 2011 00:47:39 +0200 Subject: manager: merge serialization and desrialization counter into one, and increase it when reexecuting Instead of having individual counters n_serializing and n_deserializing have a single one n_reloading, which should be sufficient. Set n_reloading when we are about to go down for reexecution to avoid cgroup trimming when we free the units for reexecution. --- src/unit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/unit.c') diff --git a/src/unit.c b/src/unit.c index a2072621b0..d4142098d1 100644 --- a/src/unit.c +++ b/src/unit.c @@ -370,7 +370,7 @@ void unit_free(Unit *u) { u->meta.manager->n_in_gc_queue--; } - cgroup_bonding_free_list(u->meta.cgroup_bondings, u->meta.manager->n_serializing <= 0); + cgroup_bonding_free_list(u->meta.cgroup_bondings, u->meta.manager->n_reloading <= 0); free(u->meta.description); free(u->meta.fragment_path); @@ -1137,7 +1137,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su * behaviour here. For example: if a mount point is remounted * this function will be called too! */ - if (u->meta.manager->n_deserializing <= 0) { + if (u->meta.manager->n_reloading <= 0) { dual_timestamp ts; dual_timestamp_get(&ts); @@ -1225,7 +1225,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su } else unexpected = true; - if (u->meta.manager->n_deserializing <= 0) { + if (u->meta.manager->n_reloading <= 0) { /* If this state change happened without being * requested by a job, then let's retroactively start @@ -1258,7 +1258,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su if (u->meta.type == UNIT_SERVICE && !UNIT_IS_ACTIVE_OR_RELOADING(os) && - u->meta.manager->n_deserializing <= 0) { + u->meta.manager->n_reloading <= 0) { /* Write audit record if we have just finished starting up */ manager_send_unit_audit(u->meta.manager, u, AUDIT_SERVICE_START, true); u->meta.in_audit = true; @@ -1275,7 +1275,7 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su if (u->meta.type == UNIT_SERVICE && UNIT_IS_INACTIVE_OR_FAILED(ns) && !UNIT_IS_INACTIVE_OR_FAILED(os) && - u->meta.manager->n_deserializing <= 0) { + u->meta.manager->n_reloading <= 0) { /* Hmm, if there was no start record written * write it now, so that we always have a nice -- cgit v1.2.3-54-g00ecf