diff options
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r-- | kernel/cgroup.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 4d67a39c58a8..4e8b16a8266c 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -586,6 +586,21 @@ static struct inode *cgroup_new_inode(mode_t mode, struct super_block *sb) | |||
586 | return inode; | 586 | return inode; |
587 | } | 587 | } |
588 | 588 | ||
589 | /* | ||
590 | * Call subsys's pre_destroy handler. | ||
591 | * This is called before css refcnt check. | ||
592 | */ | ||
593 | |||
594 | static void cgroup_call_pre_destroy(struct cgroup *cgrp) | ||
595 | { | ||
596 | struct cgroup_subsys *ss; | ||
597 | for_each_subsys(cgrp->root, ss) | ||
598 | if (ss->pre_destroy && cgrp->subsys[ss->subsys_id]) | ||
599 | ss->pre_destroy(ss, cgrp); | ||
600 | return; | ||
601 | } | ||
602 | |||
603 | |||
589 | static void cgroup_diput(struct dentry *dentry, struct inode *inode) | 604 | static void cgroup_diput(struct dentry *dentry, struct inode *inode) |
590 | { | 605 | { |
591 | /* is dentry a directory ? if so, kfree() associated cgroup */ | 606 | /* is dentry a directory ? if so, kfree() associated cgroup */ |
@@ -2160,6 +2175,13 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry) | |||
2160 | parent = cgrp->parent; | 2175 | parent = cgrp->parent; |
2161 | root = cgrp->root; | 2176 | root = cgrp->root; |
2162 | sb = root->sb; | 2177 | sb = root->sb; |
2178 | /* | ||
2179 | * Call pre_destroy handlers of subsys | ||
2180 | */ | ||
2181 | cgroup_call_pre_destroy(cgrp); | ||
2182 | /* | ||
2183 | * Notify subsyses that rmdir() request comes. | ||
2184 | */ | ||
2163 | 2185 | ||
2164 | if (cgroup_has_css_refs(cgrp)) { | 2186 | if (cgroup_has_css_refs(cgrp)) { |
2165 | mutex_unlock(&cgroup_mutex); | 2187 | mutex_unlock(&cgroup_mutex); |