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 /block | |
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 'block')
-rw-r--r-- | block/blk-cgroup.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index fa8f26309444..1359d637831f 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -28,13 +28,10 @@ static LIST_HEAD(blkio_list); | |||
28 | struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT }; | 28 | struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT }; |
29 | EXPORT_SYMBOL_GPL(blkio_root_cgroup); | 29 | EXPORT_SYMBOL_GPL(blkio_root_cgroup); |
30 | 30 | ||
31 | static struct cgroup_subsys_state *blkiocg_create(struct cgroup_subsys *, | 31 | static struct cgroup_subsys_state *blkiocg_create(struct cgroup *); |
32 | struct cgroup *); | 32 | static int blkiocg_can_attach(struct cgroup *, struct cgroup_taskset *); |
33 | static int blkiocg_can_attach(struct cgroup_subsys *, struct cgroup *, | 33 | static void blkiocg_attach(struct cgroup *, struct cgroup_taskset *); |
34 | struct cgroup_taskset *); | 34 | static void blkiocg_destroy(struct cgroup *); |
35 | static void blkiocg_attach(struct cgroup_subsys *, struct cgroup *, | ||
36 | struct cgroup_taskset *); | ||
37 | static void blkiocg_destroy(struct cgroup_subsys *, struct cgroup *); | ||
38 | static int blkiocg_populate(struct cgroup_subsys *, struct cgroup *); | 35 | static int blkiocg_populate(struct cgroup_subsys *, struct cgroup *); |
39 | 36 | ||
40 | /* for encoding cft->private value on file */ | 37 | /* for encoding cft->private value on file */ |
@@ -1548,7 +1545,7 @@ static int blkiocg_populate(struct cgroup_subsys *subsys, struct cgroup *cgroup) | |||
1548 | ARRAY_SIZE(blkio_files)); | 1545 | ARRAY_SIZE(blkio_files)); |
1549 | } | 1546 | } |
1550 | 1547 | ||
1551 | static void blkiocg_destroy(struct cgroup_subsys *subsys, struct cgroup *cgroup) | 1548 | static void blkiocg_destroy(struct cgroup *cgroup) |
1552 | { | 1549 | { |
1553 | struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgroup); | 1550 | struct blkio_cgroup *blkcg = cgroup_to_blkio_cgroup(cgroup); |
1554 | unsigned long flags; | 1551 | unsigned long flags; |
@@ -1598,8 +1595,7 @@ static void blkiocg_destroy(struct cgroup_subsys *subsys, struct cgroup *cgroup) | |||
1598 | kfree(blkcg); | 1595 | kfree(blkcg); |
1599 | } | 1596 | } |
1600 | 1597 | ||
1601 | static struct cgroup_subsys_state * | 1598 | static struct cgroup_subsys_state *blkiocg_create(struct cgroup *cgroup) |
1602 | blkiocg_create(struct cgroup_subsys *subsys, struct cgroup *cgroup) | ||
1603 | { | 1599 | { |
1604 | struct blkio_cgroup *blkcg; | 1600 | struct blkio_cgroup *blkcg; |
1605 | struct cgroup *parent = cgroup->parent; | 1601 | struct cgroup *parent = cgroup->parent; |
@@ -1628,8 +1624,7 @@ done: | |||
1628 | * of the main cic data structures. For now we allow a task to change | 1624 | * of the main cic data structures. For now we allow a task to change |
1629 | * its cgroup only if it's the only owner of its ioc. | 1625 | * its cgroup only if it's the only owner of its ioc. |
1630 | */ | 1626 | */ |
1631 | static int blkiocg_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 1627 | static int blkiocg_can_attach(struct cgroup *cgrp, struct cgroup_taskset *tset) |
1632 | struct cgroup_taskset *tset) | ||
1633 | { | 1628 | { |
1634 | struct task_struct *task; | 1629 | struct task_struct *task; |
1635 | struct io_context *ioc; | 1630 | struct io_context *ioc; |
@@ -1648,8 +1643,7 @@ static int blkiocg_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | |||
1648 | return ret; | 1643 | return ret; |
1649 | } | 1644 | } |
1650 | 1645 | ||
1651 | static void blkiocg_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 1646 | static void blkiocg_attach(struct cgroup *cgrp, struct cgroup_taskset *tset) |
1652 | struct cgroup_taskset *tset) | ||
1653 | { | 1647 | { |
1654 | struct task_struct *task; | 1648 | struct task_struct *task; |
1655 | struct io_context *ioc; | 1649 | struct io_context *ioc; |