summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-11-18 02:49:51 -0500
committerTejun Heo <tj@kernel.org>2014-11-18 02:49:51 -0500
commit56c807ba4e91f0980567b6a69de239677879b17f (patch)
tree509bdb009fdd4cbc87c75b2138e07600afc357ac /kernel/cgroup.c
parent7d172cc89b8589e4173d0c73a1ddaae408f29c9d (diff)
downloadblackbird-op-linux-56c807ba4e91f0980567b6a69de239677879b17f.tar.gz
blackbird-op-linux-56c807ba4e91f0980567b6a69de239677879b17f.zip
cgroup: add cgroup_subsys->css_e_css_changed()
Add a new cgroup_subsys operatoin ->css_e_css_changed(). This is invoked if any of the effective csses seen from the css's cgroup may have changed. This will be used to implement cgroup writeback support. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Zefan Li <lizefan@huawei.com>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index c8558693102b..69f033582a1a 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2836,6 +2836,24 @@ static ssize_t cgroup_subtree_control_write(struct kernfs_open_file *of,
}
}
+ /*
+ * The effective csses of all the descendants (excluding @cgrp) may
+ * have changed. Subsystems can optionally subscribe to this event
+ * by implementing ->css_e_css_changed() which is invoked if any of
+ * the effective csses seen from the css's cgroup may have changed.
+ */
+ for_each_subsys(ss, ssid) {
+ struct cgroup_subsys_state *this_css = cgroup_css(cgrp, ss);
+ struct cgroup_subsys_state *css;
+
+ if (!ss->css_e_css_changed || !this_css)
+ continue;
+
+ css_for_each_descendant_pre(css, this_css)
+ if (css != this_css)
+ ss->css_e_css_changed(css);
+ }
+
kernfs_activate(cgrp->kn);
ret = 0;
out_unlock:
OpenPOWER on IntegriCloud