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 | |
| 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>
| -rw-r--r-- | Documentation/cgroups/cgroups.txt | 26 | ||||
| -rw-r--r-- | block/blk-cgroup.c | 22 | ||||
| -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 | ||||
| -rw-r--r-- | kernel/cgroup.c | 43 | ||||
| -rw-r--r-- | kernel/cgroup_freezer.c | 11 | ||||
| -rw-r--r-- | kernel/cpuset.c | 16 | ||||
| -rw-r--r-- | kernel/events/core.c | 13 | ||||
| -rw-r--r-- | kernel/sched/core.c | 20 | ||||
| -rw-r--r-- | mm/memcontrol.c | 48 | ||||
| -rw-r--r-- | net/core/netprio_cgroup.c | 10 | ||||
| -rw-r--r-- | net/core/sock.c | 6 | ||||
| -rw-r--r-- | net/ipv4/tcp_memcontrol.c | 2 | ||||
| -rw-r--r-- | net/sched/cls_cgroup.c | 10 | ||||
| -rw-r--r-- | security/device_cgroup.c | 10 |
16 files changed, 113 insertions, 162 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 |
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; |
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 */ |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 43a224f167b5..865d89a580c7 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
| @@ -818,7 +818,7 @@ static int cgroup_call_pre_destroy(struct cgroup *cgrp) | |||
| 818 | 818 | ||
| 819 | for_each_subsys(cgrp->root, ss) | 819 | for_each_subsys(cgrp->root, ss) |
| 820 | if (ss->pre_destroy) { | 820 | if (ss->pre_destroy) { |
| 821 | ret = ss->pre_destroy(ss, cgrp); | 821 | ret = ss->pre_destroy(cgrp); |
| 822 | if (ret) | 822 | if (ret) |
| 823 | break; | 823 | break; |
| 824 | } | 824 | } |
| @@ -846,7 +846,7 @@ static void cgroup_diput(struct dentry *dentry, struct inode *inode) | |||
| 846 | * Release the subsystem state objects. | 846 | * Release the subsystem state objects. |
| 847 | */ | 847 | */ |
| 848 | for_each_subsys(cgrp->root, ss) | 848 | for_each_subsys(cgrp->root, ss) |
| 849 | ss->destroy(ss, cgrp); | 849 | ss->destroy(cgrp); |
| 850 | 850 | ||
| 851 | cgrp->root->number_of_cgroups--; | 851 | cgrp->root->number_of_cgroups--; |
| 852 | mutex_unlock(&cgroup_mutex); | 852 | mutex_unlock(&cgroup_mutex); |
| @@ -1015,7 +1015,7 @@ static int rebind_subsystems(struct cgroupfs_root *root, | |||
| 1015 | list_move(&ss->sibling, &root->subsys_list); | 1015 | list_move(&ss->sibling, &root->subsys_list); |
| 1016 | ss->root = root; | 1016 | ss->root = root; |
| 1017 | if (ss->bind) | 1017 | if (ss->bind) |
| 1018 | ss->bind(ss, cgrp); | 1018 | ss->bind(cgrp); |
| 1019 | mutex_unlock(&ss->hierarchy_mutex); | 1019 | mutex_unlock(&ss->hierarchy_mutex); |
| 1020 | /* refcount was already taken, and we're keeping it */ | 1020 | /* refcount was already taken, and we're keeping it */ |
| 1021 | } else if (bit & removed_bits) { | 1021 | } else if (bit & removed_bits) { |
| @@ -1025,7 +1025,7 @@ static int rebind_subsystems(struct cgroupfs_root *root, | |||
| 1025 | BUG_ON(cgrp->subsys[i]->cgroup != cgrp); | 1025 | BUG_ON(cgrp->subsys[i]->cgroup != cgrp); |
| 1026 | mutex_lock(&ss->hierarchy_mutex); | 1026 | mutex_lock(&ss->hierarchy_mutex); |
| 1027 | if (ss->bind) | 1027 | if (ss->bind) |
| 1028 | ss->bind(ss, dummytop); | 1028 | ss->bind(dummytop); |
| 1029 | dummytop->subsys[i]->cgroup = dummytop; | 1029 | dummytop->subsys[i]->cgroup = dummytop; |
| 1030 | cgrp->subsys[i] = NULL; | 1030 | cgrp->subsys[i] = NULL; |
| 1031 | subsys[i]->root = &rootnode; | 1031 | subsys[i]->root = &rootnode; |
| @@ -1908,7 +1908,7 @@ int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk) | |||
| 1908 | 1908 | ||
| 1909 | for_each_subsys(root, ss) { | 1909 | for_each_subsys(root, ss) { |
| 1910 | if (ss->can_attach) { | 1910 | if (ss->can_attach) { |
| 1911 | retval = ss->can_attach(ss, cgrp, &tset); | 1911 | retval = ss->can_attach(cgrp, &tset); |
| 1912 | if (retval) { | 1912 | if (retval) { |
| 1913 | /* | 1913 | /* |
| 1914 | * Remember on which subsystem the can_attach() | 1914 | * Remember on which subsystem the can_attach() |
| @@ -1932,7 +1932,7 @@ int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk) | |||
| 1932 | 1932 | ||
| 1933 | for_each_subsys(root, ss) { | 1933 | for_each_subsys(root, ss) { |
| 1934 | if (ss->attach) | 1934 | if (ss->attach) |
| 1935 | ss->attach(ss, cgrp, &tset); | 1935 | ss->attach(cgrp, &tset); |
| 1936 | } | 1936 | } |
| 1937 | 1937 | ||
| 1938 | synchronize_rcu(); | 1938 | synchronize_rcu(); |
| @@ -1954,7 +1954,7 @@ out: | |||
| 1954 | */ | 1954 | */ |
| 1955 | break; | 1955 | break; |
| 1956 | if (ss->cancel_attach) | 1956 | if (ss->cancel_attach) |
| 1957 | ss->cancel_attach(ss, cgrp, &tset); | 1957 | ss->cancel_attach(cgrp, &tset); |
| 1958 | } | 1958 | } |
| 1959 | } | 1959 | } |
| 1960 | return retval; | 1960 | return retval; |
| @@ -2067,7 +2067,7 @@ static int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader) | |||
| 2067 | */ | 2067 | */ |
| 2068 | for_each_subsys(root, ss) { | 2068 | for_each_subsys(root, ss) { |
| 2069 | if (ss->can_attach) { | 2069 | if (ss->can_attach) { |
| 2070 | retval = ss->can_attach(ss, cgrp, &tset); | 2070 | retval = ss->can_attach(cgrp, &tset); |
| 2071 | if (retval) { | 2071 | if (retval) { |
| 2072 | failed_ss = ss; | 2072 | failed_ss = ss; |
| 2073 | goto out_cancel_attach; | 2073 | goto out_cancel_attach; |
| @@ -2104,7 +2104,7 @@ static int cgroup_attach_proc(struct cgroup *cgrp, struct task_struct *leader) | |||
| 2104 | */ | 2104 | */ |
| 2105 | for_each_subsys(root, ss) { | 2105 | for_each_subsys(root, ss) { |
| 2106 | if (ss->attach) | 2106 | if (ss->attach) |
| 2107 | ss->attach(ss, cgrp, &tset); | 2107 | ss->attach(cgrp, &tset); |
| 2108 | } | 2108 | } |
| 2109 | 2109 | ||
| 2110 | /* | 2110 | /* |
| @@ -2128,7 +2128,7 @@ out_cancel_attach: | |||
| 2128 | if (ss == failed_ss) | 2128 | if (ss == failed_ss) |
| 2129 | break; | 2129 | break; |
| 2130 | if (ss->cancel_attach) | 2130 | if (ss->cancel_attach) |
| 2131 | ss->cancel_attach(ss, cgrp, &tset); | 2131 | ss->cancel_attach(cgrp, &tset); |
| 2132 | } | 2132 | } |
| 2133 | } | 2133 | } |
| 2134 | out_free_group_list: | 2134 | out_free_group_list: |
| @@ -3756,7 +3756,7 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, | |||
| 3756 | set_bit(CGRP_CLONE_CHILDREN, &cgrp->flags); | 3756 | set_bit(CGRP_CLONE_CHILDREN, &cgrp->flags); |
| 3757 | 3757 | ||
| 3758 | for_each_subsys(root, ss) { | 3758 | for_each_subsys(root, ss) { |
| 3759 | struct cgroup_subsys_state *css = ss->create(ss, cgrp); | 3759 | struct cgroup_subsys_state *css = ss->create(cgrp); |
| 3760 | 3760 | ||
| 3761 | if (IS_ERR(css)) { | 3761 | if (IS_ERR(css)) { |
| 3762 | err = PTR_ERR(css); | 3762 | err = PTR_ERR(css); |
| @@ -3770,7 +3770,7 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, | |||
| 3770 | } | 3770 | } |
| 3771 | /* At error, ->destroy() callback has to free assigned ID. */ | 3771 | /* At error, ->destroy() callback has to free assigned ID. */ |
| 3772 | if (clone_children(parent) && ss->post_clone) | 3772 | if (clone_children(parent) && ss->post_clone) |
| 3773 | ss->post_clone(ss, cgrp); | 3773 | ss->post_clone(cgrp); |
| 3774 | } | 3774 | } |
| 3775 | 3775 | ||
| 3776 | cgroup_lock_hierarchy(root); | 3776 | cgroup_lock_hierarchy(root); |
| @@ -3804,7 +3804,7 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry, | |||
| 3804 | 3804 | ||
| 3805 | for_each_subsys(root, ss) { | 3805 | for_each_subsys(root, ss) { |
| 3806 | if (cgrp->subsys[ss->subsys_id]) | 3806 | if (cgrp->subsys[ss->subsys_id]) |
| 3807 | ss->destroy(ss, cgrp); | 3807 | ss->destroy(cgrp); |
| 3808 | } | 3808 | } |
| 3809 | 3809 | ||
| 3810 | mutex_unlock(&cgroup_mutex); | 3810 | mutex_unlock(&cgroup_mutex); |
| @@ -4028,7 +4028,7 @@ static void __init cgroup_init_subsys(struct cgroup_subsys *ss) | |||
| 4028 | /* Create the top cgroup state for this subsystem */ | 4028 | /* Create the top cgroup state for this subsystem */ |
| 4029 | list_add(&ss->sibling, &rootnode.subsys_list); | 4029 | list_add(&ss->sibling, &rootnode.subsys_list); |
| 4030 | ss->root = &rootnode; | 4030 | ss->root = &rootnode; |
| 4031 | css = ss->create(ss, dummytop); | 4031 | css = ss->create(dummytop); |
| 4032 | /* We don't handle early failures gracefully */ | 4032 | /* We don't handle early failures gracefully */ |
| 4033 | BUG_ON(IS_ERR(css)); | 4033 | BUG_ON(IS_ERR(css)); |
| 4034 | init_cgroup_css(css, ss, dummytop); | 4034 | init_cgroup_css(css, ss, dummytop); |
| @@ -4117,7 +4117,7 @@ int __init_or_module cgroup_load_subsys(struct cgroup_subsys *ss) | |||
| 4117 | * no ss->create seems to need anything important in the ss struct, so | 4117 | * no ss->create seems to need anything important in the ss struct, so |
| 4118 | * this can happen first (i.e. before the rootnode attachment). | 4118 | * this can happen first (i.e. before the rootnode attachment). |
| 4119 | */ | 4119 | */ |
| 4120 | css = ss->create(ss, dummytop); | 4120 | css = ss->create(dummytop); |
| 4121 | if (IS_ERR(css)) { | 4121 | if (IS_ERR(css)) { |
| 4122 | /* failure case - need to deassign the subsys[] slot. */ | 4122 | /* failure case - need to deassign the subsys[] slot. */ |
| 4123 | subsys[i] = NULL; | 4123 | subsys[i] = NULL; |
| @@ -4135,7 +4135,7 @@ int __init_or_module cgroup_load_subsys(struct cgroup_subsys *ss) | |||
| 4135 | int ret = cgroup_init_idr(ss, css); | 4135 | int ret = cgroup_init_idr(ss, css); |
| 4136 | if (ret) { | 4136 | if (ret) { |
| 4137 | dummytop->subsys[ss->subsys_id] = NULL; | 4137 | dummytop->subsys[ss->subsys_id] = NULL; |
| 4138 | ss->destroy(ss, dummytop); | 4138 | ss->destroy(dummytop); |
| 4139 | subsys[i] = NULL; | 4139 | subsys[i] = NULL; |
| 4140 | mutex_unlock(&cgroup_mutex); | 4140 | mutex_unlock(&cgroup_mutex); |
| 4141 | return ret; | 4141 | return ret; |
| @@ -4233,7 +4233,7 @@ void cgroup_unload_subsys(struct cgroup_subsys *ss) | |||
| 4233 | * pointer to find their state. note that this also takes care of | 4233 | * pointer to find their state. note that this also takes care of |
| 4234 | * freeing the css_id. | 4234 | * freeing the css_id. |
| 4235 | */ | 4235 | */ |
| 4236 | ss->destroy(ss, dummytop); | 4236 | ss->destroy(dummytop); |
| 4237 | dummytop->subsys[ss->subsys_id] = NULL; | 4237 | dummytop->subsys[ss->subsys_id] = NULL; |
| 4238 | 4238 | ||
| 4239 | mutex_unlock(&cgroup_mutex); | 4239 | mutex_unlock(&cgroup_mutex); |
| @@ -4509,7 +4509,7 @@ void cgroup_fork_callbacks(struct task_struct *child) | |||
| 4509 | for (i = 0; i < CGROUP_BUILTIN_SUBSYS_COUNT; i++) { | 4509 | for (i = 0; i < CGROUP_BUILTIN_SUBSYS_COUNT; i++) { |
| 4510 | struct cgroup_subsys *ss = subsys[i]; | 4510 | struct cgroup_subsys *ss = subsys[i]; |
| 4511 | if (ss->fork) | 4511 | if (ss->fork) |
| 4512 | ss->fork(ss, child); | 4512 | ss->fork(child); |
| 4513 | } | 4513 | } |
| 4514 | } | 4514 | } |
| 4515 | } | 4515 | } |
| @@ -4611,7 +4611,7 @@ void cgroup_exit(struct task_struct *tsk, int run_callbacks) | |||
| 4611 | struct cgroup *old_cgrp = | 4611 | struct cgroup *old_cgrp = |
| 4612 | rcu_dereference_raw(cg->subsys[i])->cgroup; | 4612 | rcu_dereference_raw(cg->subsys[i])->cgroup; |
| 4613 | struct cgroup *cgrp = task_cgroup(tsk, i); | 4613 | struct cgroup *cgrp = task_cgroup(tsk, i); |
| 4614 | ss->exit(ss, cgrp, old_cgrp, tsk); | 4614 | ss->exit(cgrp, old_cgrp, tsk); |
| 4615 | } | 4615 | } |
| 4616 | } | 4616 | } |
| 4617 | } | 4617 | } |
| @@ -5066,8 +5066,7 @@ struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id) | |||
| 5066 | } | 5066 | } |
| 5067 | 5067 | ||
| 5068 | #ifdef CONFIG_CGROUP_DEBUG | 5068 | #ifdef CONFIG_CGROUP_DEBUG |
| 5069 | static struct cgroup_subsys_state *debug_create(struct cgroup_subsys *ss, | 5069 | static struct cgroup_subsys_state *debug_create(struct cgroup *cont) |
| 5070 | struct cgroup *cont) | ||
| 5071 | { | 5070 | { |
| 5072 | struct cgroup_subsys_state *css = kzalloc(sizeof(*css), GFP_KERNEL); | 5071 | struct cgroup_subsys_state *css = kzalloc(sizeof(*css), GFP_KERNEL); |
| 5073 | 5072 | ||
| @@ -5077,7 +5076,7 @@ static struct cgroup_subsys_state *debug_create(struct cgroup_subsys *ss, | |||
| 5077 | return css; | 5076 | return css; |
| 5078 | } | 5077 | } |
| 5079 | 5078 | ||
| 5080 | static void debug_destroy(struct cgroup_subsys *ss, struct cgroup *cont) | 5079 | static void debug_destroy(struct cgroup *cont) |
| 5081 | { | 5080 | { |
| 5082 | kfree(cont->subsys[debug_subsys_id]); | 5081 | kfree(cont->subsys[debug_subsys_id]); |
| 5083 | } | 5082 | } |
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index fc0646b78a64..f86e93920b62 100644 --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c | |||
| @@ -128,8 +128,7 @@ struct cgroup_subsys freezer_subsys; | |||
| 128 | * task->alloc_lock (inside __thaw_task(), prevents race with refrigerator()) | 128 | * task->alloc_lock (inside __thaw_task(), prevents race with refrigerator()) |
| 129 | * sighand->siglock | 129 | * sighand->siglock |
| 130 | */ | 130 | */ |
| 131 | static struct cgroup_subsys_state *freezer_create(struct cgroup_subsys *ss, | 131 | static struct cgroup_subsys_state *freezer_create(struct cgroup *cgroup) |
| 132 | struct cgroup *cgroup) | ||
| 133 | { | 132 | { |
| 134 | struct freezer *freezer; | 133 | struct freezer *freezer; |
| 135 | 134 | ||
| @@ -142,8 +141,7 @@ static struct cgroup_subsys_state *freezer_create(struct cgroup_subsys *ss, | |||
| 142 | return &freezer->css; | 141 | return &freezer->css; |
| 143 | } | 142 | } |
| 144 | 143 | ||
| 145 | static void freezer_destroy(struct cgroup_subsys *ss, | 144 | static void freezer_destroy(struct cgroup *cgroup) |
| 146 | struct cgroup *cgroup) | ||
| 147 | { | 145 | { |
| 148 | struct freezer *freezer = cgroup_freezer(cgroup); | 146 | struct freezer *freezer = cgroup_freezer(cgroup); |
| 149 | 147 | ||
| @@ -164,8 +162,7 @@ static bool is_task_frozen_enough(struct task_struct *task) | |||
| 164 | * a write to that file racing against an attach, and hence the | 162 | * a write to that file racing against an attach, and hence the |
| 165 | * can_attach() result will remain valid until the attach completes. | 163 | * can_attach() result will remain valid until the attach completes. |
| 166 | */ | 164 | */ |
| 167 | static int freezer_can_attach(struct cgroup_subsys *ss, | 165 | static int freezer_can_attach(struct cgroup *new_cgroup, |
| 168 | struct cgroup *new_cgroup, | ||
| 169 | struct cgroup_taskset *tset) | 166 | struct cgroup_taskset *tset) |
| 170 | { | 167 | { |
| 171 | struct freezer *freezer; | 168 | struct freezer *freezer; |
| @@ -185,7 +182,7 @@ static int freezer_can_attach(struct cgroup_subsys *ss, | |||
| 185 | return 0; | 182 | return 0; |
| 186 | } | 183 | } |
| 187 | 184 | ||
| 188 | static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task) | 185 | static void freezer_fork(struct task_struct *task) |
| 189 | { | 186 | { |
| 190 | struct freezer *freezer; | 187 | struct freezer *freezer; |
| 191 | 188 | ||
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index a09ac2b9a661..5d575836dba6 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
| @@ -1399,8 +1399,7 @@ static nodemask_t cpuset_attach_nodemask_from; | |||
| 1399 | static nodemask_t cpuset_attach_nodemask_to; | 1399 | static nodemask_t cpuset_attach_nodemask_to; |
| 1400 | 1400 | ||
| 1401 | /* Called by cgroups to determine if a cpuset is usable; cgroup_mutex held */ | 1401 | /* Called by cgroups to determine if a cpuset is usable; cgroup_mutex held */ |
| 1402 | static int cpuset_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 1402 | static int cpuset_can_attach(struct cgroup *cgrp, struct cgroup_taskset *tset) |
| 1403 | struct cgroup_taskset *tset) | ||
| 1404 | { | 1403 | { |
| 1405 | struct cpuset *cs = cgroup_cs(cgrp); | 1404 | struct cpuset *cs = cgroup_cs(cgrp); |
| 1406 | struct task_struct *task; | 1405 | struct task_struct *task; |
| @@ -1436,8 +1435,7 @@ static int cpuset_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | |||
| 1436 | return 0; | 1435 | return 0; |
| 1437 | } | 1436 | } |
| 1438 | 1437 | ||
| 1439 | static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 1438 | static void cpuset_attach(struct cgroup *cgrp, struct cgroup_taskset *tset) |
| 1440 | struct cgroup_taskset *tset) | ||
| 1441 | { | 1439 | { |
| 1442 | struct mm_struct *mm; | 1440 | struct mm_struct *mm; |
| 1443 | struct task_struct *task; | 1441 | struct task_struct *task; |
| @@ -1833,8 +1831,7 @@ static int cpuset_populate(struct cgroup_subsys *ss, struct cgroup *cont) | |||
| 1833 | * (and likewise for mems) to the new cgroup. Called with cgroup_mutex | 1831 | * (and likewise for mems) to the new cgroup. Called with cgroup_mutex |
| 1834 | * held. | 1832 | * held. |
| 1835 | */ | 1833 | */ |
| 1836 | static void cpuset_post_clone(struct cgroup_subsys *ss, | 1834 | static void cpuset_post_clone(struct cgroup *cgroup) |
| 1837 | struct cgroup *cgroup) | ||
| 1838 | { | 1835 | { |
| 1839 | struct cgroup *parent, *child; | 1836 | struct cgroup *parent, *child; |
| 1840 | struct cpuset *cs, *parent_cs; | 1837 | struct cpuset *cs, *parent_cs; |
| @@ -1857,13 +1854,10 @@ static void cpuset_post_clone(struct cgroup_subsys *ss, | |||
| 1857 | 1854 | ||
| 1858 | /* | 1855 | /* |
| 1859 | * cpuset_create - create a cpuset | 1856 | * cpuset_create - create a cpuset |
| 1860 | * ss: cpuset cgroup subsystem | ||
| 1861 | * cont: control group that the new cpuset will be part of | 1857 | * cont: control group that the new cpuset will be part of |
| 1862 | */ | 1858 | */ |
| 1863 | 1859 | ||
| 1864 | static struct cgroup_subsys_state *cpuset_create( | 1860 | static struct cgroup_subsys_state *cpuset_create(struct cgroup *cont) |
| 1865 | struct cgroup_subsys *ss, | ||
| 1866 | struct cgroup *cont) | ||
| 1867 | { | 1861 | { |
| 1868 | struct cpuset *cs; | 1862 | struct cpuset *cs; |
| 1869 | struct cpuset *parent; | 1863 | struct cpuset *parent; |
| @@ -1902,7 +1896,7 @@ static struct cgroup_subsys_state *cpuset_create( | |||
| 1902 | * will call async_rebuild_sched_domains(). | 1896 | * will call async_rebuild_sched_domains(). |
| 1903 | */ | 1897 | */ |
| 1904 | 1898 | ||
| 1905 | static void cpuset_destroy(struct cgroup_subsys *ss, struct cgroup *cont) | 1899 | static void cpuset_destroy(struct cgroup *cont) |
| 1906 | { | 1900 | { |
| 1907 | struct cpuset *cs = cgroup_cs(cont); | 1901 | struct cpuset *cs = cgroup_cs(cont); |
| 1908 | 1902 | ||
diff --git a/kernel/events/core.c b/kernel/events/core.c index a8f4ac001a00..a5d1ee92b0d9 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
| @@ -6906,8 +6906,7 @@ unlock: | |||
| 6906 | device_initcall(perf_event_sysfs_init); | 6906 | device_initcall(perf_event_sysfs_init); |
| 6907 | 6907 | ||
| 6908 | #ifdef CONFIG_CGROUP_PERF | 6908 | #ifdef CONFIG_CGROUP_PERF |
| 6909 | static struct cgroup_subsys_state *perf_cgroup_create( | 6909 | static struct cgroup_subsys_state *perf_cgroup_create(struct cgroup *cont) |
| 6910 | struct cgroup_subsys *ss, struct cgroup *cont) | ||
| 6911 | { | 6910 | { |
| 6912 | struct perf_cgroup *jc; | 6911 | struct perf_cgroup *jc; |
| 6913 | 6912 | ||
| @@ -6924,8 +6923,7 @@ static struct cgroup_subsys_state *perf_cgroup_create( | |||
| 6924 | return &jc->css; | 6923 | return &jc->css; |
| 6925 | } | 6924 | } |
| 6926 | 6925 | ||
| 6927 | static void perf_cgroup_destroy(struct cgroup_subsys *ss, | 6926 | static void perf_cgroup_destroy(struct cgroup *cont) |
| 6928 | struct cgroup *cont) | ||
| 6929 | { | 6927 | { |
| 6930 | struct perf_cgroup *jc; | 6928 | struct perf_cgroup *jc; |
| 6931 | jc = container_of(cgroup_subsys_state(cont, perf_subsys_id), | 6929 | jc = container_of(cgroup_subsys_state(cont, perf_subsys_id), |
| @@ -6941,8 +6939,7 @@ static int __perf_cgroup_move(void *info) | |||
| 6941 | return 0; | 6939 | return 0; |
| 6942 | } | 6940 | } |
| 6943 | 6941 | ||
| 6944 | static void perf_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 6942 | static void perf_cgroup_attach(struct cgroup *cgrp, struct cgroup_taskset *tset) |
| 6945 | struct cgroup_taskset *tset) | ||
| 6946 | { | 6943 | { |
| 6947 | struct task_struct *task; | 6944 | struct task_struct *task; |
| 6948 | 6945 | ||
| @@ -6950,8 +6947,8 @@ static void perf_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | |||
| 6950 | task_function_call(task, __perf_cgroup_move, task); | 6947 | task_function_call(task, __perf_cgroup_move, task); |
| 6951 | } | 6948 | } |
| 6952 | 6949 | ||
| 6953 | static void perf_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp, | 6950 | static void perf_cgroup_exit(struct cgroup *cgrp, struct cgroup *old_cgrp, |
| 6954 | struct cgroup *old_cgrp, struct task_struct *task) | 6951 | struct task_struct *task) |
| 6955 | { | 6952 | { |
| 6956 | /* | 6953 | /* |
| 6957 | * cgroup_exit() is called in the copy_process() failure path. | 6954 | * cgroup_exit() is called in the copy_process() failure path. |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index df00cb09263e..ff12f7216062 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -7530,8 +7530,7 @@ static inline struct task_group *cgroup_tg(struct cgroup *cgrp) | |||
| 7530 | struct task_group, css); | 7530 | struct task_group, css); |
| 7531 | } | 7531 | } |
| 7532 | 7532 | ||
| 7533 | static struct cgroup_subsys_state * | 7533 | static struct cgroup_subsys_state *cpu_cgroup_create(struct cgroup *cgrp) |
| 7534 | cpu_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cgrp) | ||
| 7535 | { | 7534 | { |
| 7536 | struct task_group *tg, *parent; | 7535 | struct task_group *tg, *parent; |
| 7537 | 7536 | ||
| @@ -7548,15 +7547,14 @@ cpu_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cgrp) | |||
| 7548 | return &tg->css; | 7547 | return &tg->css; |
| 7549 | } | 7548 | } |
| 7550 | 7549 | ||
| 7551 | static void | 7550 | static void cpu_cgroup_destroy(struct cgroup *cgrp) |
| 7552 | cpu_cgroup_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp) | ||
| 7553 | { | 7551 | { |
| 7554 | struct task_group *tg = cgroup_tg(cgrp); | 7552 | struct task_group *tg = cgroup_tg(cgrp); |
| 7555 | 7553 | ||
| 7556 | sched_destroy_group(tg); | 7554 | sched_destroy_group(tg); |
| 7557 | } | 7555 | } |
| 7558 | 7556 | ||
| 7559 | static int cpu_cgroup_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 7557 | static int cpu_cgroup_can_attach(struct cgroup *cgrp, |
| 7560 | struct cgroup_taskset *tset) | 7558 | struct cgroup_taskset *tset) |
| 7561 | { | 7559 | { |
| 7562 | struct task_struct *task; | 7560 | struct task_struct *task; |
| @@ -7574,7 +7572,7 @@ static int cpu_cgroup_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | |||
| 7574 | return 0; | 7572 | return 0; |
| 7575 | } | 7573 | } |
| 7576 | 7574 | ||
| 7577 | static void cpu_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | 7575 | static void cpu_cgroup_attach(struct cgroup *cgrp, |
| 7578 | struct cgroup_taskset *tset) | 7576 | struct cgroup_taskset *tset) |
| 7579 | { | 7577 | { |
| 7580 | struct task_struct *task; | 7578 | struct task_struct *task; |
| @@ -7584,8 +7582,8 @@ static void cpu_cgroup_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | |||
| 7584 | } | 7582 | } |
| 7585 | 7583 | ||
| 7586 | static void | 7584 | static void |
| 7587 | cpu_cgroup_exit(struct cgroup_subsys *ss, struct cgroup *cgrp, | 7585 | cpu_cgroup_exit(struct cgroup *cgrp, struct cgroup *old_cgrp, |
| 7588 | struct cgroup *old_cgrp, struct task_struct *task) | 7586 | struct task_struct *task) |
| 7589 | { | 7587 | { |
| 7590 | /* | 7588 | /* |
| 7591 | * cgroup_exit() is called in the copy_process() failure path. | 7589 | * cgroup_exit() is called in the copy_process() failure path. |
| @@ -7935,8 +7933,7 @@ struct cgroup_subsys cpu_cgroup_subsys = { | |||
| 7935 | */ | 7933 | */ |
| 7936 | 7934 | ||
| 7937 | /* create a new cpu accounting group */ | 7935 | /* create a new cpu accounting group */ |
| 7938 | static struct cgroup_subsys_state *cpuacct_create( | 7936 | static struct cgroup_subsys_state *cpuacct_create(struct cgroup *cgrp) |
| 7939 | struct cgroup_subsys *ss, struct cgroup *cgrp) | ||
| 7940 | { | 7937 | { |
| 7941 | struct cpuacct *ca; | 7938 | struct cpuacct *ca; |
| 7942 | 7939 | ||
| @@ -7966,8 +7963,7 @@ out: | |||
| 7966 | } | 7963 | } |
| 7967 | 7964 | ||
| 7968 | /* destroy an existing cpu accounting group */ | 7965 | /* destroy an existing cpu accounting group */ |
| 7969 | static void | 7966 | static void cpuacct_destroy(struct cgroup *cgrp) |
| 7970 | cpuacct_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp) | ||
| 7971 | { | 7967 | { |
| 7972 | struct cpuacct *ca = cgroup_ca(cgrp); | 7968 | struct cpuacct *ca = cgroup_ca(cgrp); |
| 7973 | 7969 | ||
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3dbff4dcde35..ae2f0a8ab761 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
| @@ -4580,10 +4580,9 @@ static int register_kmem_files(struct cgroup *cont, struct cgroup_subsys *ss) | |||
| 4580 | return mem_cgroup_sockets_init(cont, ss); | 4580 | return mem_cgroup_sockets_init(cont, ss); |
| 4581 | }; | 4581 | }; |
| 4582 | 4582 | ||
| 4583 | static void kmem_cgroup_destroy(struct cgroup_subsys *ss, | 4583 | static void kmem_cgroup_destroy(struct cgroup *cont) |
| 4584 | struct cgroup *cont) | ||
| 4585 | { | 4584 | { |
| 4586 | mem_cgroup_sockets_destroy(cont, ss); | 4585 | mem_cgroup_sockets_destroy(cont); |
| 4587 | } | 4586 | } |
| 4588 | #else | 4587 | #else |
| 4589 | static int register_kmem_files(struct cgroup *cont, struct cgroup_subsys *ss) | 4588 | static int register_kmem_files(struct cgroup *cont, struct cgroup_subsys *ss) |
| @@ -4591,8 +4590,7 @@ static int register_kmem_files(struct cgroup *cont, struct cgroup_subsys *ss) | |||
| 4591 | return 0; | 4590 | return 0; |
| 4592 | } | 4591 | } |
| 4593 | 4592 | ||
| 4594 | static void kmem_cgroup_destroy(struct cgroup_subsys *ss, | 4593 | static void kmem_cgroup_destroy(struct cgroup *cont) |
| 4595 | struct cgroup *cont) | ||
| 4596 | { | 4594 | { |
| 4597 | } | 4595 | } |
| 4598 | #endif | 4596 | #endif |
| @@ -4884,7 +4882,7 @@ err_cleanup: | |||
| 4884 | } | 4882 | } |
| 4885 | 4883 | ||
| 4886 | static struct cgroup_subsys_state * __ref | 4884 | static struct cgroup_subsys_state * __ref |
| 4887 | mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont) | 4885 | mem_cgroup_create(struct cgroup *cont) |
| 4888 | { | 4886 | { |
| 4889 | struct mem_cgroup *memcg, *parent; | 4887 | struct mem_cgroup *memcg, *parent; |
| 4890 | long error = -ENOMEM; | 4888 | long error = -ENOMEM; |
| @@ -4946,20 +4944,18 @@ free_out: | |||
| 4946 | return ERR_PTR(error); | 4944 | return ERR_PTR(error); |
| 4947 | } | 4945 | } |
| 4948 | 4946 | ||
| 4949 | static int mem_cgroup_pre_destroy(struct cgroup_subsys *ss, | 4947 | static int mem_cgroup_pre_destroy(struct cgroup *cont) |
| 4950 | struct cgroup *cont) | ||
| 4951 | { | 4948 | { |
| 4952 | struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); | 4949 | struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); |
| 4953 | 4950 | ||
| 4954 | return mem_cgroup_force_empty(memcg, false); | 4951 | return mem_cgroup_force_empty(memcg, false); |
| 4955 | } | 4952 | } |
| 4956 | 4953 | ||
| 4957 | static void mem_cgroup_destroy(struct cgroup_subsys *ss, | 4954 | static void mem_cgroup_destroy(struct cgroup *cont) |
| 4958 | struct cgroup *cont) | ||
| 4959 | { | 4955 | { |
| 4960 | struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); | 4956 | struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); |
| 4961 | 4957 | ||
| 4962 | kmem_cgroup_destroy(ss, cont); | 4958 | kmem_cgroup_destroy(cont); |
| 4963 | 4959 | ||
| 4964 | mem_cgroup_put(memcg); | 4960 | mem_cgroup_put(memcg); |
| 4965 | } | 4961 | } |
| @@ -5296,9 +5292,8 @@ static void mem_cgroup_clear_mc(void) | |||
| 5296 | mem_cgroup_end_move(from); | 5292 | mem_cgroup_end_move(from); |
| 5297 | } | 5293 | } |
| 5298 | 5294 | ||
| 5299 | static int mem_cgroup_can_attach(struct cgroup_subsys *ss, | 5295 | static int mem_cgroup_can_attach(struct cgroup *cgroup, |
| 5300 | struct cgroup *cgroup, | 5296 | struct cgroup_taskset *tset) |
| 5301 | struct cgroup_taskset *tset) | ||
| 5302 | { | 5297 | { |
| 5303 | struct task_struct *p = cgroup_taskset_first(tset); | 5298 | struct task_struct *p = cgroup_taskset_first(tset); |
| 5304 | int ret = 0; | 5299 | int ret = 0; |
| @@ -5336,9 +5331,8 @@ static int mem_cgroup_can_attach(struct cgroup_subsys *ss, | |||
| 5336 | return ret; | 5331 | return ret; |
| 5337 | } | 5332 | } |
| 5338 | 5333 | ||
| 5339 | static void mem_cgroup_cancel_attach(struct cgroup_subsys *ss, | 5334 | static void mem_cgroup_cancel_attach(struct cgroup *cgroup, |
| 5340 | struct cgroup *cgroup, | 5335 | struct cgroup_taskset *tset) |
| 5341 | struct cgroup_taskset *tset) | ||
| 5342 | { | 5336 | { |
| 5343 | mem_cgroup_clear_mc(); | 5337 | mem_cgroup_clear_mc(); |
| 5344 | } | 5338 | } |
| @@ -5453,9 +5447,8 @@ retry: | |||
| 5453 | up_read(&mm->mmap_sem); | 5447 | up_read(&mm->mmap_sem); |
| 5454 | } | 5448 | } |
| 5455 | 5449 | ||
| 5456 | static void mem_cgroup_move_task(struct cgroup_subsys *ss, | 5450 | static void mem_cgroup_move_task(struct cgroup *cont, |
| 5457 | struct cgroup *cont, | 5451 | struct cgroup_taskset *tset) |
| 5458 | struct cgroup_taskset *tset) | ||
| 5459 | { | 5452 | { |
| 5460 | struct task_struct *p = cgroup_taskset_first(tset); | 5453 | struct task_struct *p = cgroup_taskset_first(tset); |
| 5461 | struct mm_struct *mm = get_task_mm(p); | 5454 | struct mm_struct *mm = get_task_mm(p); |
| @@ -5470,20 +5463,17 @@ static void mem_cgroup_move_task(struct cgroup_subsys *ss, | |||
| 5470 | mem_cgroup_clear_mc(); | 5463 | mem_cgroup_clear_mc(); |
| 5471 | } | 5464 | } |
| 5472 | #else /* !CONFIG_MMU */ | 5465 | #else /* !CONFIG_MMU */ |
| 5473 | static int mem_cgroup_can_attach(struct cgroup_subsys *ss, | 5466 | static int mem_cgroup_can_attach(struct cgroup *cgroup, |
| 5474 | struct cgroup *cgroup, | 5467 | struct cgroup_taskset *tset) |
| 5475 | struct cgroup_taskset *tset) | ||
| 5476 | { | 5468 | { |
| 5477 | return 0; | 5469 | return 0; |
| 5478 | } | 5470 | } |
| 5479 | static void mem_cgroup_cancel_attach(struct cgroup_subsys *ss, | 5471 | static void mem_cgroup_cancel_attach(struct cgroup *cgroup, |
| 5480 | struct cgroup *cgroup, | 5472 | struct cgroup_taskset *tset) |
| 5481 | struct cgroup_taskset *tset) | ||
| 5482 | { | 5473 | { |
| 5483 | } | 5474 | } |
| 5484 | static void mem_cgroup_move_task(struct cgroup_subsys *ss, | 5475 | static void mem_cgroup_move_task(struct cgroup *cont, |
| 5485 | struct cgroup *cont, | 5476 | struct cgroup_taskset *tset) |
| 5486 | struct cgroup_taskset *tset) | ||
| 5487 | { | 5477 | { |
| 5488 | } | 5478 | } |
| 5489 | #endif | 5479 | #endif |
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 |
diff --git a/net/ipv4/tcp_memcontrol.c b/net/ipv4/tcp_memcontrol.c index 49978788a9dc..e714c6834c90 100644 --- a/net/ipv4/tcp_memcontrol.c +++ b/net/ipv4/tcp_memcontrol.c | |||
| @@ -94,7 +94,7 @@ create_files: | |||
| 94 | } | 94 | } |
| 95 | EXPORT_SYMBOL(tcp_init_cgroup); | 95 | EXPORT_SYMBOL(tcp_init_cgroup); |
| 96 | 96 | ||
| 97 | void tcp_destroy_cgroup(struct cgroup *cgrp, struct cgroup_subsys *ss) | 97 | void tcp_destroy_cgroup(struct cgroup *cgrp) |
| 98 | { | 98 | { |
| 99 | struct mem_cgroup *memcg = mem_cgroup_from_cont(cgrp); | 99 | struct mem_cgroup *memcg = mem_cgroup_from_cont(cgrp); |
| 100 | struct cg_proto *cg_proto; | 100 | struct cg_proto *cg_proto; |
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index f84fdc3a7f27..1afaa284fcd7 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c | |||
| @@ -22,9 +22,8 @@ | |||
| 22 | #include <net/sock.h> | 22 | #include <net/sock.h> |
| 23 | #include <net/cls_cgroup.h> | 23 | #include <net/cls_cgroup.h> |
| 24 | 24 | ||
| 25 | static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss, | 25 | static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp); |
| 26 | struct cgroup *cgrp); | 26 | static void cgrp_destroy(struct cgroup *cgrp); |
| 27 | static void cgrp_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp); | ||
| 28 | static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp); | 27 | static int cgrp_populate(struct cgroup_subsys *ss, struct cgroup *cgrp); |
| 29 | 28 | ||
| 30 | struct cgroup_subsys net_cls_subsys = { | 29 | struct cgroup_subsys net_cls_subsys = { |
| @@ -51,8 +50,7 @@ static inline struct cgroup_cls_state *task_cls_state(struct task_struct *p) | |||
| 51 | struct cgroup_cls_state, css); | 50 | struct cgroup_cls_state, css); |
| 52 | } | 51 | } |
| 53 | 52 | ||
| 54 | static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss, | 53 | static struct cgroup_subsys_state *cgrp_create(struct cgroup *cgrp) |
| 55 | struct cgroup *cgrp) | ||
| 56 | { | 54 | { |
| 57 | struct cgroup_cls_state *cs; | 55 | struct cgroup_cls_state *cs; |
| 58 | 56 | ||
| @@ -66,7 +64,7 @@ static struct cgroup_subsys_state *cgrp_create(struct cgroup_subsys *ss, | |||
| 66 | return &cs->css; | 64 | return &cs->css; |
| 67 | } | 65 | } |
| 68 | 66 | ||
| 69 | static void cgrp_destroy(struct cgroup_subsys *ss, struct cgroup *cgrp) | 67 | static void cgrp_destroy(struct cgroup *cgrp) |
| 70 | { | 68 | { |
| 71 | kfree(cgrp_cls_state(cgrp)); | 69 | kfree(cgrp_cls_state(cgrp)); |
| 72 | } | 70 | } |
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 8b5b5d8612c6..c43a3323feea 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
| @@ -61,8 +61,8 @@ static inline struct dev_cgroup *task_devcgroup(struct task_struct *task) | |||
| 61 | 61 | ||
| 62 | struct cgroup_subsys devices_subsys; | 62 | struct cgroup_subsys devices_subsys; |
| 63 | 63 | ||
| 64 | static int devcgroup_can_attach(struct cgroup_subsys *ss, | 64 | static int devcgroup_can_attach(struct cgroup *new_cgrp, |
| 65 | struct cgroup *new_cgrp, struct cgroup_taskset *set) | 65 | struct cgroup_taskset *set) |
| 66 | { | 66 | { |
| 67 | struct task_struct *task = cgroup_taskset_first(set); | 67 | struct task_struct *task = cgroup_taskset_first(set); |
| 68 | 68 | ||
| @@ -156,8 +156,7 @@ remove: | |||
| 156 | /* | 156 | /* |
| 157 | * called from kernel/cgroup.c with cgroup_lock() held. | 157 | * called from kernel/cgroup.c with cgroup_lock() held. |
| 158 | */ | 158 | */ |
| 159 | static struct cgroup_subsys_state *devcgroup_create(struct cgroup_subsys *ss, | 159 | static struct cgroup_subsys_state *devcgroup_create(struct cgroup *cgroup) |
| 160 | struct cgroup *cgroup) | ||
| 161 | { | 160 | { |
| 162 | struct dev_cgroup *dev_cgroup, *parent_dev_cgroup; | 161 | struct dev_cgroup *dev_cgroup, *parent_dev_cgroup; |
| 163 | struct cgroup *parent_cgroup; | 162 | struct cgroup *parent_cgroup; |
| @@ -195,8 +194,7 @@ static struct cgroup_subsys_state *devcgroup_create(struct cgroup_subsys *ss, | |||
| 195 | return &dev_cgroup->css; | 194 | return &dev_cgroup->css; |
| 196 | } | 195 | } |
| 197 | 196 | ||
| 198 | static void devcgroup_destroy(struct cgroup_subsys *ss, | 197 | static void devcgroup_destroy(struct cgroup *cgroup) |
| 199 | struct cgroup *cgroup) | ||
| 200 | { | 198 | { |
| 201 | struct dev_cgroup *dev_cgroup; | 199 | struct dev_cgroup *dev_cgroup; |
| 202 | struct dev_whitelist_item *wh, *tmp; | 200 | struct dev_whitelist_item *wh, *tmp; |
