diff options
-rw-r--r-- | include/linux/cgroup.h | 1 | ||||
-rw-r--r-- | kernel/cgroup.c | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index e717a39f22ea..3a04aeb8b5a1 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -615,6 +615,7 @@ struct cgroup_subsys { | |||
615 | void (*css_released)(struct cgroup_subsys_state *css); | 615 | void (*css_released)(struct cgroup_subsys_state *css); |
616 | void (*css_free)(struct cgroup_subsys_state *css); | 616 | void (*css_free)(struct cgroup_subsys_state *css); |
617 | void (*css_reset)(struct cgroup_subsys_state *css); | 617 | void (*css_reset)(struct cgroup_subsys_state *css); |
618 | void (*css_e_css_changed)(struct cgroup_subsys_state *css); | ||
618 | 619 | ||
619 | int (*can_attach)(struct cgroup_subsys_state *css, | 620 | int (*can_attach)(struct cgroup_subsys_state *css, |
620 | struct cgroup_taskset *tset); | 621 | struct cgroup_taskset *tset); |
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, | |||
2836 | } | 2836 | } |
2837 | } | 2837 | } |
2838 | 2838 | ||
2839 | /* | ||
2840 | * The effective csses of all the descendants (excluding @cgrp) may | ||
2841 | * have changed. Subsystems can optionally subscribe to this event | ||
2842 | * by implementing ->css_e_css_changed() which is invoked if any of | ||
2843 | * the effective csses seen from the css's cgroup may have changed. | ||
2844 | */ | ||
2845 | for_each_subsys(ss, ssid) { | ||
2846 | struct cgroup_subsys_state *this_css = cgroup_css(cgrp, ss); | ||
2847 | struct cgroup_subsys_state *css; | ||
2848 | |||
2849 | if (!ss->css_e_css_changed || !this_css) | ||
2850 | continue; | ||
2851 | |||
2852 | css_for_each_descendant_pre(css, this_css) | ||
2853 | if (css != this_css) | ||
2854 | ss->css_e_css_changed(css); | ||
2855 | } | ||
2856 | |||
2839 | kernfs_activate(cgrp->kn); | 2857 | kernfs_activate(cgrp->kn); |
2840 | ret = 0; | 2858 | ret = 0; |
2841 | out_unlock: | 2859 | out_unlock: |