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 /Documentation/cgroups | |
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 'Documentation/cgroups')
-rw-r--r-- | Documentation/cgroups/cgroups.txt | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/Documentation/cgroups/cgroups.txt b/Documentation/cgroups/cgroups.txt index a7c96ae5557c..8e74980ab385 100644 --- a/Documentation/cgroups/cgroups.txt +++ b/Documentation/cgroups/cgroups.txt | |||
@@ -558,8 +558,7 @@ Each subsystem may export the following methods. The only mandatory | |||
558 | methods are create/destroy. Any others that are null are presumed to | 558 | methods are create/destroy. Any others that are null are presumed to |
559 | be successful no-ops. | 559 | be successful no-ops. |
560 | 560 | ||
561 | struct cgroup_subsys_state *create(struct cgroup_subsys *ss, | 561 | struct cgroup_subsys_state *create(struct cgroup *cgrp) |
562 | struct cgroup *cgrp) | ||
563 | (cgroup_mutex held by caller) | 562 | (cgroup_mutex held by caller) |
564 | 563 | ||
565 | Called to create a subsystem state object for a cgroup. The | 564 | Called to create a subsystem state object for a cgroup. The |
@@ -574,7 +573,7 @@ identified by the passed cgroup object having a NULL parent (since | |||
574 | it's the root of the hierarchy) and may be an appropriate place for | 573 | it's the root of the hierarchy) and may be an appropriate place for |
575 | initialization code. | 574 | initialization code. |
576 | 575 | ||
577 | void destroy(struct cgroup_subsys *ss, struct cgroup *cgrp) | 576 | void destroy(struct cgroup *cgrp) |
578 | (cgroup_mutex held by caller) | 577 | (cgroup_mutex held by caller) |
579 | 578 | ||
580 | The cgroup system is about to destroy the passed cgroup; the subsystem | 579 | The cgroup system is about to destroy the passed cgroup; the subsystem |
@@ -585,7 +584,7 @@ cgroup->parent is still valid. (Note - can also be called for a | |||
585 | newly-created cgroup if an error occurs after this subsystem's | 584 | newly-created cgroup if an error occurs after this subsystem's |
586 | create() method has been called for the new cgroup). | 585 | create() method has been called for the new cgroup). |
587 | 586 | ||
588 | int pre_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp); | 587 | int pre_destroy(struct cgroup *cgrp); |
589 | 588 | ||
590 | Called before checking the reference count on each subsystem. This may | 589 | Called before checking the reference count on each subsystem. This may |
591 | be useful for subsystems which have some extra references even if | 590 | be useful for subsystems which have some extra references even if |
@@ -593,8 +592,7 @@ there are not tasks in the cgroup. If pre_destroy() returns error code, | |||
593 | rmdir() will fail with it. From this behavior, pre_destroy() can be | 592 | rmdir() will fail with it. From this behavior, pre_destroy() can be |
594 | called multiple times against a cgroup. | 593 | called multiple times against a cgroup. |
595 | 594 | ||
596 | int can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 595 | int can_attach(struct cgroup *cgrp, struct cgroup_taskset *tset) |
597 | struct cgroup_taskset *tset) | ||
598 | (cgroup_mutex held by caller) | 596 | (cgroup_mutex held by caller) |
599 | 597 | ||
600 | Called prior to moving one or more tasks into a cgroup; if the | 598 | Called prior to moving one or more tasks into a cgroup; if the |
@@ -615,8 +613,7 @@ fork. If this method returns 0 (success) then this should remain valid | |||
615 | while the caller holds cgroup_mutex and it is ensured that either | 613 | while the caller holds cgroup_mutex and it is ensured that either |
616 | attach() or cancel_attach() will be called in future. | 614 | attach() or cancel_attach() will be called in future. |
617 | 615 | ||
618 | void cancel_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 616 | void cancel_attach(struct cgroup *cgrp, struct cgroup_taskset *tset) |
619 | struct cgroup_taskset *tset) | ||
620 | (cgroup_mutex held by caller) | 617 | (cgroup_mutex held by caller) |
621 | 618 | ||
622 | Called when a task attach operation has failed after can_attach() has succeeded. | 619 | Called when a task attach operation has failed after can_attach() has succeeded. |
@@ -625,23 +622,22 @@ function, so that the subsystem can implement a rollback. If not, not necessary. | |||
625 | This will be called only about subsystems whose can_attach() operation have | 622 | This will be called only about subsystems whose can_attach() operation have |
626 | succeeded. The parameters are identical to can_attach(). | 623 | succeeded. The parameters are identical to can_attach(). |
627 | 624 | ||
628 | void attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 625 | void attach(struct cgroup *cgrp, struct cgroup_taskset *tset) |
629 | struct cgroup_taskset *tset) | ||
630 | (cgroup_mutex held by caller) | 626 | (cgroup_mutex held by caller) |
631 | 627 | ||
632 | Called after the task has been attached to the cgroup, to allow any | 628 | Called after the task has been attached to the cgroup, to allow any |
633 | post-attachment activity that requires memory allocations or blocking. | 629 | post-attachment activity that requires memory allocations or blocking. |
634 | The parameters are identical to can_attach(). | 630 | The parameters are identical to can_attach(). |
635 | 631 | ||
636 | void fork(struct cgroup_subsy *ss, struct task_struct *task) | 632 | void fork(struct task_struct *task) |
637 | 633 | ||
638 | Called when a task is forked into a cgroup. | 634 | Called when a task is forked into a cgroup. |
639 | 635 | ||
640 | void exit(struct cgroup_subsys *ss, struct task_struct *task) | 636 | void exit(struct task_struct *task) |
641 | 637 | ||
642 | Called during task exit. | 638 | Called during task exit. |
643 | 639 | ||
644 | int populate(struct cgroup_subsys *ss, struct cgroup *cgrp) | 640 | int populate(struct cgroup *cgrp) |
645 | (cgroup_mutex held by caller) | 641 | (cgroup_mutex held by caller) |
646 | 642 | ||
647 | Called after creation of a cgroup to allow a subsystem to populate | 643 | Called after creation of a cgroup to allow a subsystem to populate |
@@ -651,7 +647,7 @@ include/linux/cgroup.h for details). Note that although this | |||
651 | method can return an error code, the error code is currently not | 647 | method can return an error code, the error code is currently not |
652 | always handled well. | 648 | always handled well. |
653 | 649 | ||
654 | void post_clone(struct cgroup_subsys *ss, struct cgroup *cgrp) | 650 | void post_clone(struct cgroup *cgrp) |
655 | (cgroup_mutex held by caller) | 651 | (cgroup_mutex held by caller) |
656 | 652 | ||
657 | Called during cgroup_create() to do any parameter | 653 | Called during cgroup_create() to do any parameter |
@@ -659,7 +655,7 @@ initialization which might be required before a task could attach. For | |||
659 | example in cpusets, no task may attach before 'cpus' and 'mems' are set | 655 | example in cpusets, no task may attach before 'cpus' and 'mems' are set |
660 | up. | 656 | up. |
661 | 657 | ||
662 | void bind(struct cgroup_subsys *ss, struct cgroup *root) | 658 | void bind(struct cgroup *root) |
663 | (cgroup_mutex and ss->hierarchy_mutex held by caller) | 659 | (cgroup_mutex and ss->hierarchy_mutex held by caller) |
664 | 660 | ||
665 | Called when a cgroup subsystem is rebound to a different hierarchy | 661 | Called when a cgroup subsystem is rebound to a different hierarchy |