diff options
| author | Li Zefan <lizf@cn.fujitsu.com> | 2012-01-31 00:47:36 -0500 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2012-02-02 12:20:22 -0500 |
| commit | 761b3ef50e1c2649cffbfa67a4dcb2dcdb7982ed (patch) | |
| tree | 67ab6a9a2520811c9c0b4d70d1c19b4bfca16237 /include | |
| parent | 61d1d219c4c0761059236a46867bc49943c4d29d (diff) | |
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>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/cgroup.h | 29 | ||||
| -rw-r--r-- | include/net/sock.h | 7 | ||||
| -rw-r--r-- | include/net/tcp_memcontrol.h | 2 |
3 files changed, 16 insertions, 22 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 7da3e745b74c..501adb1b2f43 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -452,23 +452,18 @@ int cgroup_taskset_size(struct cgroup_taskset *tset); | |||
| 452 | */ | 452 | */ |
| 453 | 453 | ||
| 454 | struct cgroup_subsys { | 454 | struct cgroup_subsys { |
| 455 | struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, | 455 | struct cgroup_subsys_state *(*create)(struct cgroup *cgrp); |
| 456 | struct cgroup *cgrp); | 456 | int (*pre_destroy)(struct cgroup *cgrp); |
| 457 | int (*pre_destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 457 | void (*destroy)(struct cgroup *cgrp); |
| 458 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 458 | int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); |
| 459 | int (*can_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 459 | void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); |
| 460 | struct cgroup_taskset *tset); | 460 | void (*attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); |
| 461 | void (*cancel_attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 461 | void (*fork)(struct task_struct *task); |
| 462 | struct cgroup_taskset *tset); | 462 | void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp, |
| 463 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 463 | struct task_struct *task); |
| 464 | struct cgroup_taskset *tset); | 464 | int (*populate)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
| 465 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); | 465 | void (*post_clone)(struct cgroup *cgrp); |
| 466 | void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp, | 466 | void (*bind)(struct cgroup *root); |
| 467 | struct cgroup *old_cgrp, struct task_struct *task); | ||
| 468 | int (*populate)(struct cgroup_subsys *ss, | ||
| 469 | struct cgroup *cgrp); | ||
| 470 | void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp); | ||
| 471 | void (*bind)(struct cgroup_subsys *ss, struct cgroup *root); | ||
| 472 | 467 | ||
| 473 | int subsys_id; | 468 | int subsys_id; |
| 474 | int active; | 469 | int active; |
diff --git a/include/net/sock.h b/include/net/sock.h index bb972d254dff..705d1add19a1 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -68,7 +68,7 @@ struct cgroup; | |||
| 68 | struct cgroup_subsys; | 68 | struct cgroup_subsys; |
| 69 | #ifdef CONFIG_NET | 69 | #ifdef CONFIG_NET |
| 70 | int mem_cgroup_sockets_init(struct cgroup *cgrp, struct cgroup_subsys *ss); | 70 | int mem_cgroup_sockets_init(struct cgroup *cgrp, struct cgroup_subsys *ss); |
| 71 | void mem_cgroup_sockets_destroy(struct cgroup *cgrp, struct cgroup_subsys *ss); | 71 | void mem_cgroup_sockets_destroy(struct cgroup *cgrp); |
| 72 | #else | 72 | #else |
| 73 | static inline | 73 | static inline |
| 74 | int mem_cgroup_sockets_init(struct cgroup *cgrp, struct cgroup_subsys *ss) | 74 | int mem_cgroup_sockets_init(struct cgroup *cgrp, struct cgroup_subsys *ss) |
| @@ -76,7 +76,7 @@ int mem_cgroup_sockets_init(struct cgroup *cgrp, struct cgroup_subsys *ss) | |||
| 76 | return 0; | 76 | return 0; |
| 77 | } | 77 | } |
| 78 | static inline | 78 | static inline |
| 79 | void mem_cgroup_sockets_destroy(struct cgroup *cgrp, struct cgroup_subsys *ss) | 79 | void mem_cgroup_sockets_destroy(struct cgroup *cgrp) |
| 80 | { | 80 | { |
| 81 | } | 81 | } |
| 82 | #endif | 82 | #endif |
| @@ -869,8 +869,7 @@ struct proto { | |||
| 869 | */ | 869 | */ |
| 870 | int (*init_cgroup)(struct cgroup *cgrp, | 870 | int (*init_cgroup)(struct cgroup *cgrp, |
| 871 | struct cgroup_subsys *ss); | 871 | struct cgroup_subsys *ss); |
| 872 | void (*destroy_cgroup)(struct cgroup *cgrp, | 872 | void (*destroy_cgroup)(struct cgroup *cgrp); |
| 873 | struct cgroup_subsys *ss); | ||
| 874 | struct cg_proto *(*proto_cgroup)(struct mem_cgroup *memcg); | 873 | struct cg_proto *(*proto_cgroup)(struct mem_cgroup *memcg); |
| 875 | #endif | 874 | #endif |
| 876 | }; | 875 | }; |
diff --git a/include/net/tcp_memcontrol.h b/include/net/tcp_memcontrol.h index 3512082fa909..48410ff25c9e 100644 --- a/include/net/tcp_memcontrol.h +++ b/include/net/tcp_memcontrol.h | |||
| @@ -13,7 +13,7 @@ struct tcp_memcontrol { | |||
| 13 | 13 | ||
| 14 | struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg); | 14 | struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg); |
| 15 | int tcp_init_cgroup(struct cgroup *cgrp, struct cgroup_subsys *ss); | 15 | int tcp_init_cgroup(struct cgroup *cgrp, struct cgroup_subsys *ss); |
| 16 | void tcp_destroy_cgroup(struct cgroup *cgrp, struct cgroup_subsys *ss); | 16 | void tcp_destroy_cgroup(struct cgroup *cgrp); |
| 17 | unsigned long long tcp_max_memory(const struct mem_cgroup *memcg); | 17 | unsigned long long tcp_max_memory(const struct mem_cgroup *memcg); |
| 18 | void tcp_prot_mem(struct mem_cgroup *memcg, long val, int idx); | 18 | void tcp_prot_mem(struct mem_cgroup *memcg, long val, int idx); |
| 19 | #endif /* _TCP_MEMCG_H */ | 19 | #endif /* _TCP_MEMCG_H */ |
