X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fmanager.h;h=a3049b5e5b665fe7937ca4cf2a3274cdb8670732;hb=51d122af23533b0b8318911c4fc8b128ad8eafb7;hp=3969553e3ed791e83a3e7cdf470454cab25d1eb1;hpb=e21fea24ae2a7a04f6d5c9d2bbbaf5833d248952;p=elogind.git diff --git a/src/core/manager.h b/src/core/manager.h index 3969553e3..a3049b5e5 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -103,9 +103,6 @@ struct Manager { * type we maintain a per type linked list */ LIST_HEAD(Unit, units_by_type[_UNIT_TYPE_MAX]); - /* To optimize iteration of units that have requires_mounts_for set */ - LIST_HEAD(Unit, has_requires_mounts_for); - /* Units that need to be loaded */ LIST_HEAD(Unit, load_queue); /* this is actually more a stack than a queue, but uh. */ @@ -251,6 +248,11 @@ struct Manager { char *switch_root; char *switch_root_init; + + /* This maps all possible path prefixes to the units needing + * them. It's a hashmap with a path string as key and a Set as + * value where Unit objects are contained. */ + Hashmap *units_requiring_mounts_for; }; int manager_new(SystemdRunningAs running_as, bool reexecuting, Manager **m); @@ -263,6 +265,8 @@ int manager_startup(Manager *m, FILE *serialization, FDSet *fds); Job *manager_get_job(Manager *m, uint32_t id); Unit *manager_get_unit(Manager *m, const char *name); +int manager_get_unit_by_path(Manager *m, const char *path, const char *suffix, Unit **_found); + int manager_get_job_from_dbus_path(Manager *m, const char *s, Job **_j); int manager_load_unit_prepare(Manager *m, const char *name, const char *path, DBusError *e, Unit **_ret); @@ -316,4 +320,6 @@ void manager_recheck_journal(Manager *m); void manager_set_show_status(Manager *m, bool b); void manager_status_printf(Manager *m, bool ephemeral, const char *status, const char *format, ...) _printf_attr_(4,5); +Set *manager_get_units_requiring_mounts_for(Manager *m, const char *path); + void watch_init(Watch *w);