From 703920c14a3caa66862bd12b88a7ed6460ebef6b Mon Sep 17 00:00:00 2001 From: Amit Pundir Date: Mon, 21 Dec 2015 16:01:10 +0530 Subject: cgroup: refactor allow_attach handler for 4.4 Refactor *allow_attach() handler to align it with the changes from mainline commit 1f7dd3e5a6e4 "cgroup: fix handling of multi-destination migration from subtree_control enabling". Signed-off-by: Amit Pundir --- kernel/cgroup.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'kernel') diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 7fd423e55046..a57b7c86871c 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -2663,15 +2663,16 @@ static int cgroup_attach_task(struct cgroup *dst_cgrp, return ret; } -int subsys_cgroup_allow_attach(struct cgroup_subsys_state *css, struct cgroup_taskset *tset) +int subsys_cgroup_allow_attach(struct cgroup_taskset *tset) { const struct cred *cred = current_cred(), *tcred; struct task_struct *task; + struct cgroup_subsys_state *css; if (capable(CAP_SYS_NICE)) return 0; - cgroup_taskset_for_each(task, tset) { + cgroup_taskset_for_each(task, css, tset) { tcred = __task_cred(task); if (current != task && !uid_eq(cred->euid, tcred->uid) && @@ -2690,7 +2691,7 @@ static int cgroup_allow_attach(struct cgroup *cgrp, struct cgroup_taskset *tset) for_each_css(css, i, cgrp) { if (css->ss->allow_attach) { - ret = css->ss->allow_attach(css, tset); + ret = css->ss->allow_attach(tset); if (ret) return ret; } else { -- cgit v1.2.3