Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56c807ba authored by Tejun Heo's avatar Tejun Heo
Browse files

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: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarZefan Li <lizefan@huawei.com>
parent 7d172cc8
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -615,6 +615,7 @@ struct cgroup_subsys {
	void (*css_released)(struct cgroup_subsys_state *css);
	void (*css_released)(struct cgroup_subsys_state *css);
	void (*css_free)(struct cgroup_subsys_state *css);
	void (*css_free)(struct cgroup_subsys_state *css);
	void (*css_reset)(struct cgroup_subsys_state *css);
	void (*css_reset)(struct cgroup_subsys_state *css);
	void (*css_e_css_changed)(struct cgroup_subsys_state *css);


	int (*can_attach)(struct cgroup_subsys_state *css,
	int (*can_attach)(struct cgroup_subsys_state *css,
			  struct cgroup_taskset *tset);
			  struct cgroup_taskset *tset);
+18 −0
Original line number Original line Diff line number Diff line
@@ -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);
	kernfs_activate(cgrp->kn);
	ret = 0;
	ret = 0;
out_unlock:
out_unlock: