aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-11-19 11:13:38 -0500
committerTejun Heo <tj@kernel.org>2012-11-19 11:13:38 -0500
commit92fb97487a7e41b222c1417cabd1d1ab7cc3a48c (patch)
treec220c622b9ac9b16535535d448e9cd29be72c77e /mm
parentb1929db42f8a649d9a9e397119f628c27fd4021f (diff)
cgroup: rename ->create/post_create/pre_destroy/destroy() to ->css_alloc/online/offline/free()
Rename cgroup_subsys css lifetime related callbacks to better describe what their roles are. Also, update documentation. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/hugetlb_cgroup.c14
-rw-r--r--mm/memcontrol.c12
2 files changed, 13 insertions, 13 deletions
diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c
index 0d3a1a317731..b5bde7a5c017 100644
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -77,7 +77,7 @@ static inline bool hugetlb_cgroup_have_usage(struct cgroup *cg)
77 return false; 77 return false;
78} 78}
79 79
80static struct cgroup_subsys_state *hugetlb_cgroup_create(struct cgroup *cgroup) 80static struct cgroup_subsys_state *hugetlb_cgroup_css_alloc(struct cgroup *cgroup)
81{ 81{
82 int idx; 82 int idx;
83 struct cgroup *parent_cgroup; 83 struct cgroup *parent_cgroup;
@@ -101,7 +101,7 @@ static struct cgroup_subsys_state *hugetlb_cgroup_create(struct cgroup *cgroup)
101 return &h_cgroup->css; 101 return &h_cgroup->css;
102} 102}
103 103
104static void hugetlb_cgroup_destroy(struct cgroup *cgroup) 104static void hugetlb_cgroup_css_free(struct cgroup *cgroup)
105{ 105{
106 struct hugetlb_cgroup *h_cgroup; 106 struct hugetlb_cgroup *h_cgroup;
107 107
@@ -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 */
158static void hugetlb_cgroup_pre_destroy(struct cgroup *cgroup) 158static void hugetlb_cgroup_css_offline(struct cgroup *cgroup)
159{ 159{
160 struct hstate *h; 160 struct hstate *h;
161 struct page *page; 161 struct page *page;
@@ -404,8 +404,8 @@ void hugetlb_cgroup_migrate(struct page *oldhpage, struct page *newhpage)
404 404
405struct cgroup_subsys hugetlb_subsys = { 405struct cgroup_subsys hugetlb_subsys = {
406 .name = "hugetlb", 406 .name = "hugetlb",
407 .create = hugetlb_cgroup_create, 407 .css_alloc = hugetlb_cgroup_css_alloc,
408 .pre_destroy = hugetlb_cgroup_pre_destroy, 408 .css_offline = hugetlb_cgroup_css_offline,
409 .destroy = hugetlb_cgroup_destroy, 409 .css_free = hugetlb_cgroup_css_free,
410 .subsys_id = hugetlb_subsys_id, 410 .subsys_id = hugetlb_subsys_id,
411}; 411};
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 08adaaae6fcc..8b0b2b028e23 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4922,7 +4922,7 @@ err_cleanup:
4922} 4922}
4923 4923
4924static struct cgroup_subsys_state * __ref 4924static struct cgroup_subsys_state * __ref
4925mem_cgroup_create(struct cgroup *cont) 4925mem_cgroup_css_alloc(struct cgroup *cont)
4926{ 4926{
4927 struct mem_cgroup *memcg, *parent; 4927 struct mem_cgroup *memcg, *parent;
4928 long error = -ENOMEM; 4928 long error = -ENOMEM;
@@ -5003,14 +5003,14 @@ free_out:
5003 return ERR_PTR(error); 5003 return ERR_PTR(error);
5004} 5004}
5005 5005
5006static void mem_cgroup_pre_destroy(struct cgroup *cont) 5006static void mem_cgroup_css_offline(struct cgroup *cont)
5007{ 5007{
5008 struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); 5008 struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
5009 5009
5010 mem_cgroup_reparent_charges(memcg); 5010 mem_cgroup_reparent_charges(memcg);
5011} 5011}
5012 5012
5013static void mem_cgroup_destroy(struct cgroup *cont) 5013static void mem_cgroup_css_free(struct cgroup *cont)
5014{ 5014{
5015 struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); 5015 struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
5016 5016
@@ -5600,9 +5600,9 @@ static void mem_cgroup_move_task(struct cgroup *cont,
5600struct cgroup_subsys mem_cgroup_subsys = { 5600struct cgroup_subsys mem_cgroup_subsys = {
5601 .name = "memory", 5601 .name = "memory",
5602 .subsys_id = mem_cgroup_subsys_id, 5602 .subsys_id = mem_cgroup_subsys_id,
5603 .create = mem_cgroup_create, 5603 .css_alloc = mem_cgroup_css_alloc,
5604 .pre_destroy = mem_cgroup_pre_destroy, 5604 .css_offline = mem_cgroup_css_offline,
5605 .destroy = mem_cgroup_destroy, 5605 .css_free = mem_cgroup_css_free,
5606 .can_attach = mem_cgroup_can_attach, 5606 .can_attach = mem_cgroup_can_attach,
5607 .cancel_attach = mem_cgroup_cancel_attach, 5607 .cancel_attach = mem_cgroup_cancel_attach,
5608 .attach = mem_cgroup_move_task, 5608 .attach = mem_cgroup_move_task,