From fb385181517aa97fc5b379380cde0c2567f5f444 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 10 Jul 2010 17:34:42 +0200 Subject: unit: trim cgroups when going down --- src/cgroup.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/cgroup.c') diff --git a/src/cgroup.c b/src/cgroup.c index 27130a9c39..244a602024 100644 --- a/src/cgroup.c +++ b/src/cgroup.c @@ -101,6 +101,20 @@ void cgroup_bonding_free_list(CGroupBonding *first) { cgroup_bonding_free(b); } +void cgroup_bonding_trim(CGroupBonding *b, bool delete_root) { + assert(b); + + if (b->realized && b->only_us && b->clean_up) + cg_trim(b->controller, b->path, delete_root); +} + +void cgroup_bonding_trim_list(CGroupBonding *first, bool delete_root) { + CGroupBonding *b; + + LIST_FOREACH(by_unit, b, first) + cgroup_bonding_trim(b, delete_root); +} + int cgroup_bonding_install(CGroupBonding *b, pid_t pid) { int r; -- cgit v1.2.3-54-g00ecf