cgroup: make ->pre_destroy() return void
authorTejun Heo <tj@kernel.org>
Mon, 5 Nov 2012 17:16:59 +0000 (09:16 -0800)
committerTejun Heo <tj@kernel.org>
Mon, 5 Nov 2012 17:16:59 +0000 (09:16 -0800)
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>
block/blk-cgroup.c
include/linux/cgroup.h
kernel/cgroup.c
mm/hugetlb_cgroup.c
mm/memcontrol.c

index f3b44a65fc7ad5f127bee8bcbadf5b486a7e5c71..a7816f3d00593d165480bb9b91d0fcf1b2944ae3 100644 (file)
@@ -600,7 +600,7 @@ struct cftype blkcg_files[] = {
  *
  * This is the blkcg counterpart of ioc_release_fn().
  */
-static int blkcg_pre_destroy(struct cgroup *cgroup)
+static void blkcg_pre_destroy(struct cgroup *cgroup)
 {
        struct blkcg *blkcg = cgroup_to_blkcg(cgroup);
 
@@ -622,7 +622,6 @@ static int blkcg_pre_destroy(struct cgroup *cgroup)
        }
 
        spin_unlock_irq(&blkcg->lock);
-       return 0;
 }
 
 static void blkcg_destroy(struct cgroup *cgroup)
index 47868a86ba2bdb15966e8eb396b9a94ee81ac2db..adb2adc8ec1abd26e93fbddbcf25eed5cfb61b2b 100644 (file)
@@ -436,7 +436,7 @@ int cgroup_taskset_size(struct cgroup_taskset *tset);
 
 struct cgroup_subsys {
        struct cgroup_subsys_state *(*create)(struct cgroup *cgrp);
-       int (*pre_destroy)(struct cgroup *cgrp);
+       void (*pre_destroy)(struct cgroup *cgrp);
        void (*destroy)(struct cgroup *cgrp);
        int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
        void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
index c5f6fb28dd0e7badf197af28c9da6dfd8cf97dcb..83cd7d041c62ce0a7cda67cbeddbf4882e73dc30 100644 (file)
@@ -4054,7 +4054,7 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry)
        mutex_unlock(&cgroup_mutex);
        for_each_subsys(cgrp->root, ss)
                if (ss->pre_destroy)
-                       WARN_ON_ONCE(ss->pre_destroy(cgrp));
+                       ss->pre_destroy(cgrp);
        mutex_lock(&cgroup_mutex);
 
        /*
index dc595c6b1f55607939b74b6db1ef57c752431a71..0d3a1a317731b164708000f9ed8a6f3c2c3e8b12 100644 (file)
@@ -155,7 +155,7 @@ out:
  * Force the hugetlb cgroup to empty the hugetlb resources by moving them to
  * the parent cgroup.
  */
-static int hugetlb_cgroup_pre_destroy(struct cgroup *cgroup)
+static void hugetlb_cgroup_pre_destroy(struct cgroup *cgroup)
 {
        struct hstate *h;
        struct page *page;
@@ -172,8 +172,6 @@ static int hugetlb_cgroup_pre_destroy(struct cgroup *cgroup)
                }
                cond_resched();
        } while (hugetlb_cgroup_have_usage(cgroup));
-
-       return 0;
 }
 
 int hugetlb_cgroup_charge_cgroup(int idx, unsigned long nr_pages,
index 6678f991c6c6ced9f66b39fb850cb449133b58e9..a1811ce60e20f597b76417727e94b4e19a1aa098 100644 (file)
@@ -5002,12 +5002,11 @@ free_out:
        return ERR_PTR(error);
 }
 
-static int mem_cgroup_pre_destroy(struct cgroup *cont)
+static void mem_cgroup_pre_destroy(struct cgroup *cont)
 {
        struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
 
        mem_cgroup_reparent_charges(memcg);
-       return 0;
 }
 
 static void mem_cgroup_destroy(struct cgroup *cont)