void (*css_reset)(struct cgroup_subsys_state *css);
void (*css_e_css_changed)(struct cgroup_subsys_state *css);
- int (*allow_attach)(struct cgroup_subsys_state *css,
- struct cgroup_taskset *tset);
+ int (*allow_attach)(struct cgroup_taskset *tset);
int (*can_attach)(struct cgroup_taskset *tset);
void (*cancel_attach)(struct cgroup_taskset *tset);
void (*attach)(struct cgroup_taskset *tset);
* running as root.
* Returns 0 if this is allowed, or -EACCES otherwise.
*/
-int subsys_cgroup_allow_attach(struct cgroup_subsys_state *css,
- struct cgroup_taskset *tset);
+int subsys_cgroup_allow_attach(struct cgroup_taskset *tset);
#else /* !CONFIG_CGROUPS */
static inline int cgroup_init_early(void) { return 0; }
static inline int cgroup_init(void) { return 0; }
-static inline int subsys_cgroup_allow_attach(struct cgroup_subsys_state *css,
- void *tset)
+static inline int subsys_cgroup_allow_attach(void *tset)
{
return -EINVAL;
}
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) &&
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 {
return ret;
}
-static int mem_cgroup_allow_attach(struct cgroup_subsys_state *css,
- struct cgroup_taskset *tset)
+static int mem_cgroup_allow_attach(struct cgroup_taskset *tset)
{
- return subsys_cgroup_allow_attach(css, tset);
+ return subsys_cgroup_allow_attach(tset);
}
static void mem_cgroup_cancel_attach(struct cgroup_taskset *tset)
{
return 0;
}
-static int mem_cgroup_allow_attach(struct cgroup_subsys_state *css,
- struct cgroup_taskset *tset)
+static int mem_cgroup_allow_attach(struct cgroup_taskset *tset)
{
return 0;
}