From 7c8fa05c4d5d01748ff2a04edb882afb3119b7d7 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 29 Apr 2012 14:26:07 +0200 Subject: unit: add new dependency type RequiresMountsFor= RequiresMountsFor= is a shortcut for adding requires and after dependencies to all mount units neeed for the specified paths. This solves a couple of issues regarding dep loop cycles for encrypted swap. --- src/core/unit.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core/unit.h') diff --git a/src/core/unit.h b/src/core/unit.h index c2bae0a45c..33920892fd 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -153,6 +153,8 @@ struct Unit { Set *names; Set *dependencies[_UNIT_DEPENDENCY_MAX]; + char **requires_mounts_for; + char *description; char *fragment_path; /* if loaded from a config file this is the primary path to it */ @@ -186,6 +188,9 @@ struct Unit { /* Per type list */ LIST_FIELDS(Unit, units_by_type); + /* All units which have requires_mounts_for set */ + LIST_FIELDS(Unit, has_requires_mounts_for); + /* Load queue */ LIST_FIELDS(Unit, load_queue); @@ -554,6 +559,9 @@ void unit_ref_unset(UnitRef *ref); #define UNIT_DEREF(ref) ((ref).unit) +int unit_add_one_mount_link(Unit *u, Mount *m); +int unit_add_mount_links(Unit *u); + const char *unit_load_state_to_string(UnitLoadState i); UnitLoadState unit_load_state_from_string(const char *s); -- cgit v1.2.3-54-g00ecf