cgroup: remove cgroup_subsys argument from callbacks
The argument is not used at all, and it's not necessary, because a specific callback handler of course knows which subsys it belongs to. Now only ->pupulate() takes this argument, because the handlers of this callback always call cgroup_add_file()/cgroup_add_files(). So we reduce a few lines of code, though the shrinking of object size is minimal. 16 files changed, 113 insertions(+), 162 deletions(-) text data bss dec hex filename 5486240 656987 7039960 13183187 c928d3 vmlinux.o.orig 5486170 656987 7039960 13183117 c9288d vmlinux.o Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
@@ -452,23 +452,18 @@ int cgroup_taskset_size(struct cgroup_taskset *tset);
|
||||
*/
|
||||
|
||||
struct cgroup_subsys {
|
||||
struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss,
|
||||
struct cgroup *cgrp);
|
||||
int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct cgroup_taskset *tset);
|
||||
void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct cgroup_taskset *tset);
|
||||
void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct cgroup_taskset *tset);
|
||||
void (*fork)(struct cgroup_subsys *ss, struct task_struct *task);
|
||||
void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp,
|
||||
struct cgroup *old_cgrp, struct task_struct *task);
|
||||
int (*populate)(struct cgroup_subsys *ss,
|
||||
struct cgroup *cgrp);
|
||||
void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
void (*bind)(struct cgroup_subsys *ss, struct cgroup *root);
|
||||
struct cgroup_subsys_state *(*create)(struct cgroup *cgrp);
|
||||
int (*pre_destroy)(struct cgroup *cgrp);
|
||||
void (*destroy)(struct cgroup *cgrp);
|
||||
int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
|
||||
void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
|
||||
void (*attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
|
||||
void (*fork)(struct task_struct *task);
|
||||
void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp,
|
||||
struct task_struct *task);
|
||||
int (*populate)(struct cgroup_subsys *ss, struct cgroup *cgrp);
|
||||
void (*post_clone)(struct cgroup *cgrp);
|
||||
void (*bind)(struct cgroup *root);
|
||||
|
||||
int subsys_id;
|
||||
int active;
|
||||
|
Reference in New Issue
Block a user