summaryrefslogtreecommitdiff
path: root/src/cgroup.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-10 17:34:42 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-10 17:34:42 +0200
commitfb385181517aa97fc5b379380cde0c2567f5f444 (patch)
tree91c7ee6fd3313830806c987f0d89fa383717e3aa /src/cgroup.c
parent582a507f1abdca75abe34945b4bbd5e97e9b45a8 (diff)
unit: trim cgroups when going down
Diffstat (limited to 'src/cgroup.c')
-rw-r--r--src/cgroup.c14
1 files changed, 14 insertions, 0 deletions
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;