diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 860f36052b..a6a9e0c7d4 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -1495,6 +1495,14 @@ CGroupMask unit_get_delegate_mask(Unit *u) { return CGROUP_MASK_EXTEND_JOINED(c->delegate_controllers); } +static CGroupMask unit_get_subtree_mask(Unit *u) { + + /* Returns the mask of this subtree, meaning of the group + * itself and its children. */ + + return unit_get_own_mask(u) | unit_get_members_mask(u); +} + CGroupMask unit_get_members_mask(Unit *u) { assert(u); @@ -1532,7 +1540,7 @@ CGroupMask unit_get_siblings_mask(Unit *u) { return unit_get_subtree_mask(u); /* we are the top-level slice */ } -CGroupMask unit_get_disable_mask(Unit *u) { +static CGroupMask unit_get_disable_mask(Unit *u) { CGroupContext *c; c = unit_get_cgroup_context(u); @@ -1557,14 +1565,6 @@ CGroupMask unit_get_ancestor_disable_mask(Unit *u) { return mask; } -CGroupMask unit_get_subtree_mask(Unit *u) { - - /* Returns the mask of this subtree, meaning of the group - * itself and its children. */ - - return unit_get_own_mask(u) | unit_get_members_mask(u); -} - CGroupMask unit_get_target_mask(Unit *u) { CGroupMask mask; @@ -2177,7 +2177,7 @@ static int unit_realize_cgroup_now_disable(Unit *u, ManagerState state) { /* The cgroup for this unit might not actually be fully * realised yet, in which case it isn't holding any controllers * open anyway. */ - if (!m->cgroup_path) + if (!m->cgroup_realized) continue; /* We must disable those below us first in order to release the diff --git a/src/core/cgroup.h b/src/core/cgroup.h index be9632d8b6..9ac5c8bfc0 100644 --- a/src/core/cgroup.h +++ b/src/core/cgroup.h @@ -203,8 +203,6 @@ CGroupMask unit_get_own_mask(Unit *u); CGroupMask unit_get_delegate_mask(Unit *u); CGroupMask unit_get_members_mask(Unit *u); CGroupMask unit_get_siblings_mask(Unit *u); -CGroupMask unit_get_subtree_mask(Unit *u); -CGroupMask unit_get_disable_mask(Unit *u); CGroupMask unit_get_ancestor_disable_mask(Unit *u); CGroupMask unit_get_target_mask(Unit *u); diff --git a/src/shared/cgroup-setup.c b/src/shared/cgroup-setup.c index cd2ba6149e..856e776296 100644 --- a/src/shared/cgroup-setup.c +++ b/src/shared/cgroup-setup.c @@ -655,23 +655,6 @@ int cg_attach_everywhere(CGroupMask supported, const char *path, pid_t pid, cg_m return 0; } -int cg_attach_many_everywhere(CGroupMask supported, const char *path, Set* pids, cg_migrate_callback_t path_callback, void *userdata) { - Iterator i; - void *pidp; - int r = 0; - - SET_FOREACH(pidp, pids, i) { - pid_t pid = PTR_TO_PID(pidp); - int q; - - q = cg_attach_everywhere(supported, path, pid, path_callback, userdata); - if (q < 0 && r >= 0) - r = q; - } - - return r; -} - int cg_migrate_v1_controllers(CGroupMask supported, CGroupMask mask, const char *from, cg_migrate_callback_t to_callback, void *userdata) { CGroupController c; CGroupMask done; diff --git a/src/shared/cgroup-setup.h b/src/shared/cgroup-setup.h index 72c2b6ee6a..43ce32e30d 100644 --- a/src/shared/cgroup-setup.h +++ b/src/shared/cgroup-setup.h @@ -28,7 +28,6 @@ int cg_migrate_recursive_fallback(const char *cfrom, const char *pfrom, const ch int cg_create_everywhere(CGroupMask supported, CGroupMask mask, const char *path); int cg_attach_everywhere(CGroupMask supported, const char *path, pid_t pid, cg_migrate_callback_t callback, void *userdata); -int cg_attach_many_everywhere(CGroupMask supported, const char *path, Set* pids, cg_migrate_callback_t callback, void *userdata); int cg_migrate_v1_controllers(CGroupMask supported, CGroupMask mask, const char *from, cg_migrate_callback_t to_callback, void *userdata); int cg_trim_everywhere(CGroupMask supported, const char *path, bool delete_root); int cg_trim_v1_controllers(CGroupMask supported, CGroupMask mask, const char *path, bool delete_root);