diff options
author | Tejun Heo <tj@kernel.org> | 2012-11-05 12:16:59 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2012-11-05 12:16:59 -0500 |
commit | bcf6de1b9129531215d26dd9af8331e84973bc52 (patch) | |
tree | 0666760423e4579a50a7752568036a13e0cfa9d5 | |
parent | 9d093cb10eb482adfba6ddc71a0969b78823ee8b (diff) |
cgroup: make ->pre_destroy() return void
All ->pre_destory() implementations return 0 now, which is the only
allowed return value. Make it return void.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Li Zefan <lizefan@huawei.com>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
-rw-r--r-- | block/blk-cgroup.c | 3 | ||||
-rw-r--r-- | include/linux/cgroup.h | 2 | ||||
-rw-r--r-- | kernel/cgroup.c | 2 | ||||
-rw-r--r-- | mm/hugetlb_cgroup.c | 4 | ||||
-rw-r--r-- | mm/memcontrol.c | 3 |
5 files changed, 5 insertions, 9 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index f3b44a65fc7a..a7816f3d0059 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -600,7 +600,7 @@ struct cftype blkcg_files[] = { | |||
600 | * | 600 | * |
601 | * This is the blkcg counterpart of ioc_release_fn(). | 601 | * This is the blkcg counterpart of ioc_release_fn(). |
602 | */ | 602 | */ |
603 | static int blkcg_pre_destroy(struct cgroup *cgroup) | 603 | static void blkcg_pre_destroy(struct cgroup *cgroup) |
604 | { | 604 | { |
605 | struct blkcg *blkcg = cgroup_to_blkcg(cgroup); | 605 | struct blkcg *blkcg = cgroup_to_blkcg(cgroup); |
606 | 606 | ||
@@ -622,7 +622,6 @@ static int blkcg_pre_destroy(struct cgroup *cgroup) | |||
622 | } | 622 | } |
623 | 623 | ||
624 | spin_unlock_irq(&blkcg->lock); | 624 | spin_unlock_irq(&blkcg->lock); |
625 | return 0; | ||
626 | } | 625 | } |
627 | 626 | ||
628 | static void blkcg_destroy(struct cgroup *cgroup) | 627 | static void blkcg_destroy(struct cgroup *cgroup) |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 47868a86ba2b..adb2adc8ec1a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -436,7 +436,7 @@ int cgroup_taskset_size(struct cgroup_taskset *tset); | |||
436 | 436 | ||
437 | struct cgroup_subsys { | 437 | struct cgroup_subsys { |
438 | struct cgroup_subsys_state *(*create)(struct cgroup *cgrp); | 438 | struct cgroup_subsys_state *(*create)(struct cgroup *cgrp); |
439 | int (*pre_destroy)(struct cgroup *cgrp); | 439 | void (*pre_destroy)(struct cgroup *cgrp); |
440 | void (*destroy)(struct cgroup *cgrp); | 440 | void (*destroy)(struct cgroup *cgrp); |
441 | int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); | 441 | int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); |
442 | void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); | 442 | void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index c5f6fb28dd0e..83cd7d041c62 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -4054,7 +4054,7 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry) | |||
4054 | mutex_unlock(&cgroup_mutex); | 4054 | mutex_unlock(&cgroup_mutex); |
4055 | for_each_subsys(cgrp->root, ss) | 4055 | for_each_subsys(cgrp->root, ss) |
4056 | if (ss->pre_destroy) | 4056 | if (ss->pre_destroy) |
4057 | WARN_ON_ONCE(ss->pre_destroy(cgrp)); | 4057 | ss->pre_destroy(cgrp); |
4058 | mutex_lock(&cgroup_mutex); | 4058 | mutex_lock(&cgroup_mutex); |
4059 | 4059 | ||
4060 | /* | 4060 | /* |
diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c index dc595c6b1f55..0d3a1a317731 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c | |||
@@ -155,7 +155,7 @@ out: | |||
155 | * Force the hugetlb cgroup to empty the hugetlb resources by moving them to | 155 | * Force the hugetlb cgroup to empty the hugetlb resources by moving them to |
156 | * the parent cgroup. | 156 | * the parent cgroup. |
157 | */ | 157 | */ |
158 | static int hugetlb_cgroup_pre_destroy(struct cgroup *cgroup) | 158 | static void hugetlb_cgroup_pre_destroy(struct cgroup *cgroup) |
159 | { | 159 | { |
160 | struct hstate *h; | 160 | struct hstate *h; |
161 | struct page *page; | 161 | struct page *page; |
@@ -172,8 +172,6 @@ static int hugetlb_cgroup_pre_destroy(struct cgroup *cgroup) | |||
172 | } | 172 | } |
173 | cond_resched(); | 173 | cond_resched(); |
174 | } while (hugetlb_cgroup_have_usage(cgroup)); | 174 | } while (hugetlb_cgroup_have_usage(cgroup)); |
175 | |||
176 | return 0; | ||
177 | } | 175 | } |
178 | 176 | ||
179 | int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages, | 177 | int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages, |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 6678f991c6c6..a1811ce60e20 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -5002,12 +5002,11 @@ free_out: | |||
5002 | return ERR_PTR(error); | 5002 | return ERR_PTR(error); |
5003 | } | 5003 | } |
5004 | 5004 | ||
5005 | static int mem_cgroup_pre_destroy(struct cgroup *cont) | 5005 | static void mem_cgroup_pre_destroy(struct cgroup *cont) |
5006 | { | 5006 | { |
5007 | struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); | 5007 | struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); |
5008 | 5008 | ||
5009 | mem_cgroup_reparent_charges(memcg); | 5009 | mem_cgroup_reparent_charges(memcg); |
5010 | return 0; | ||
5011 | } | 5010 | } |
5012 | 5011 | ||
5013 | static void mem_cgroup_destroy(struct cgroup *cont) | 5012 | static void mem_cgroup_destroy(struct cgroup *cont) |