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 /net/core | |
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 'net/core')
-rw-r--r-- | net/core/netprio_cgroup.c | 10 | ||||
-rw-r--r-- | net/core/sock.c | 6 |
2 files changed, 7 insertions, 9 deletions
diff --git a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c index 3a9fd4826b75..22036ab732cf 100644 --- a/net/core/netprio_cgroup.c +++ b/net/core/netprio_cgroup.c | |||
@@ -23,9 +23,8 @@ | |||
23 | #include <net/sock.h> | 23 | #include <net/sock.h> |
24 | #include <net/netprio_cgroup.h> | 24 | #include <net/netprio_cgroup.h> |
25 | 25 | ||
26 | static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss, | 26 | static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp); |
27 | struct cgroup *cgrp); | 27 | static void cgrp_destroy(struct cgroup *cgrp); |
28 | static void cgrp_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp); | ||
29 | static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp); | 28 | static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp); |
30 | 29 | ||
31 | struct cgroup_subsys net_prio_subsys = { | 30 | struct cgroup_subsys net_prio_subsys = { |
@@ -120,8 +119,7 @@ static void update_netdev_tables(void) | |||
120 | rtnl_unlock(); | 119 | rtnl_unlock(); |
121 | } | 120 | } |
122 | 121 | ||
123 | static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss, | 122 | static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp) |
124 | struct cgroup *cgrp) | ||
125 | { | 123 | { |
126 | struct cgroup_netprio_state *cs; | 124 | struct cgroup_netprio_state *cs; |
127 | int ret; | 125 | int ret; |
@@ -145,7 +143,7 @@ static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss, | |||
145 | return &cs->css; | 143 | return &cs->css; |
146 | } | 144 | } |
147 | 145 | ||
148 | static void cgrp_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp) | 146 | static void cgrp_destroy(struct cgroup *cgrp) |
149 | { | 147 | { |
150 | struct cgroup_netprio_state *cs; | 148 | struct cgroup_netprio_state *cs; |
151 | struct net_device *dev; | 149 | struct net_device *dev; |
diff --git a/net/core/sock.c b/net/core/sock.c index 5c5af9988f94..688037cb3b6e 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -160,19 +160,19 @@ int mem_cgroup_sockets_init(struct cgroup *cgrp, struct cgroup_subsys *ss) | |||
160 | out: | 160 | out: |
161 | list_for_each_entry_continue_reverse(proto, &proto_list, node) | 161 | list_for_each_entry_continue_reverse(proto, &proto_list, node) |
162 | if (proto->destroy_cgroup) | 162 | if (proto->destroy_cgroup) |
163 | proto->destroy_cgroup(cgrp, ss); | 163 | proto->destroy_cgroup(cgrp); |
164 | mutex_unlock(&proto_list_mutex); | 164 | mutex_unlock(&proto_list_mutex); |
165 | return ret; | 165 | return ret; |
166 | } | 166 | } |
167 | 167 | ||
168 | void mem_cgroup_sockets_destroy(struct cgroup *cgrp, struct cgroup_subsys *ss) | 168 | void mem_cgroup_sockets_destroy(struct cgroup *cgrp) |
169 | { | 169 | { |
170 | struct proto *proto; | 170 | struct proto *proto; |
171 | 171 | ||
172 | mutex_lock(&proto_list_mutex); | 172 | mutex_lock(&proto_list_mutex); |
173 | list_for_each_entry_reverse(proto, &proto_list, node) | 173 | list_for_each_entry_reverse(proto, &proto_list, node) |
174 | if (proto->destroy_cgroup) | 174 | if (proto->destroy_cgroup) |
175 | proto->destroy_cgroup(cgrp, ss); | 175 | proto->destroy_cgroup(cgrp); |
176 | mutex_unlock(&proto_list_mutex); | 176 | mutex_unlock(&proto_list_mutex); |
177 | } | 177 | } |
178 | #endif | 178 | #endif |