aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-05-14 09:15:00 -0400
committerTejun Heo <tj@kernel.org>2014-05-14 09:15:00 -0400
commit9d800df12d31734a6853915e9d2deb5d6747985f (patch)
tree936ff26905eb211065e2a19dce736c8e4f40202a /kernel/cgroup.c
parenta015edd26e28afe225cdd04f25794bd2b3bbe2da (diff)
cgroup: rename cgroup->dummy_css to ->self and move it to the top
cgroup->dummy_css is used as the placeholder css when performing css oriended operations on the cgroup. We're gonna shift more cgroup management to this css. Let's rename it to ->self and move it to the top. This is pure rename and field relocation. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f36fd9c15b3a..b57a949ae4bc 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -220,7 +220,7 @@ static void cgroup_idr_remove(struct idr *idr, int id)
220/** 220/**
221 * cgroup_css - obtain a cgroup's css for the specified subsystem 221 * cgroup_css - obtain a cgroup's css for the specified subsystem
222 * @cgrp: the cgroup of interest 222 * @cgrp: the cgroup of interest
223 * @ss: the subsystem of interest (%NULL returns the dummy_css) 223 * @ss: the subsystem of interest (%NULL returns @cgrp->self)
224 * 224 *
225 * Return @cgrp's css (cgroup_subsys_state) associated with @ss. This 225 * Return @cgrp's css (cgroup_subsys_state) associated with @ss. This
226 * function must be called either under cgroup_mutex or rcu_read_lock() and 226 * function must be called either under cgroup_mutex or rcu_read_lock() and
@@ -235,13 +235,13 @@ static struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp,
235 return rcu_dereference_check(cgrp->subsys[ss->id], 235 return rcu_dereference_check(cgrp->subsys[ss->id],
236 lockdep_is_held(&cgroup_mutex)); 236 lockdep_is_held(&cgroup_mutex));
237 else 237 else
238 return &cgrp->dummy_css; 238 return &cgrp->self;
239} 239}
240 240
241/** 241/**
242 * cgroup_e_css - obtain a cgroup's effective css for the specified subsystem 242 * cgroup_e_css - obtain a cgroup's effective css for the specified subsystem
243 * @cgrp: the cgroup of interest 243 * @cgrp: the cgroup of interest
244 * @ss: the subsystem of interest (%NULL returns the dummy_css) 244 * @ss: the subsystem of interest (%NULL returns @cgrp->self)
245 * 245 *
246 * Similar to cgroup_css() but returns the effctive css, which is defined 246 * Similar to cgroup_css() but returns the effctive css, which is defined
247 * as the matching css of the nearest ancestor including self which has @ss 247 * as the matching css of the nearest ancestor including self which has @ss
@@ -254,7 +254,7 @@ static struct cgroup_subsys_state *cgroup_e_css(struct cgroup *cgrp,
254 lockdep_assert_held(&cgroup_mutex); 254 lockdep_assert_held(&cgroup_mutex);
255 255
256 if (!ss) 256 if (!ss)
257 return &cgrp->dummy_css; 257 return &cgrp->self;
258 258
259 if (!(cgrp->root->subsys_mask & (1 << ss->id))) 259 if (!(cgrp->root->subsys_mask & (1 << ss->id)))
260 return NULL; 260 return NULL;
@@ -288,7 +288,7 @@ struct cgroup_subsys_state *of_css(struct kernfs_open_file *of)
288 if (cft->ss) 288 if (cft->ss)
289 return rcu_dereference_raw(cgrp->subsys[cft->ss->id]); 289 return rcu_dereference_raw(cgrp->subsys[cft->ss->id]);
290 else 290 else
291 return &cgrp->dummy_css; 291 return &cgrp->self;
292} 292}
293EXPORT_SYMBOL_GPL(of_css); 293EXPORT_SYMBOL_GPL(of_css);
294 294
@@ -1551,7 +1551,7 @@ static void init_cgroup_housekeeping(struct cgroup *cgrp)
1551 INIT_LIST_HEAD(&cgrp->release_list); 1551 INIT_LIST_HEAD(&cgrp->release_list);
1552 INIT_LIST_HEAD(&cgrp->pidlists); 1552 INIT_LIST_HEAD(&cgrp->pidlists);
1553 mutex_init(&cgrp->pidlist_mutex); 1553 mutex_init(&cgrp->pidlist_mutex);
1554 cgrp->dummy_css.cgroup = cgrp; 1554 cgrp->self.cgroup = cgrp;
1555 1555
1556 for_each_subsys(ss, ssid) 1556 for_each_subsys(ss, ssid)
1557 INIT_LIST_HEAD(&cgrp->e_csets[ssid]); 1557 INIT_LIST_HEAD(&cgrp->e_csets[ssid]);
@@ -3454,7 +3454,7 @@ int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from)
3454 * ->can_attach() fails. 3454 * ->can_attach() fails.
3455 */ 3455 */
3456 do { 3456 do {
3457 css_task_iter_start(&from->dummy_css, &it); 3457 css_task_iter_start(&from->self, &it);
3458 task = css_task_iter_next(&it); 3458 task = css_task_iter_next(&it);
3459 if (task) 3459 if (task)
3460 get_task_struct(task); 3460 get_task_struct(task);
@@ -3719,7 +3719,7 @@ static int pidlist_array_load(struct cgroup *cgrp, enum cgroup_filetype type,
3719 if (!array) 3719 if (!array)
3720 return -ENOMEM; 3720 return -ENOMEM;
3721 /* now, populate the array */ 3721 /* now, populate the array */
3722 css_task_iter_start(&cgrp->dummy_css, &it); 3722 css_task_iter_start(&cgrp->self, &it);
3723 while ((tsk = css_task_iter_next(&it))) { 3723 while ((tsk = css_task_iter_next(&it))) {
3724 if (unlikely(n == length)) 3724 if (unlikely(n == length))
3725 break; 3725 break;
@@ -3793,7 +3793,7 @@ int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry)
3793 } 3793 }
3794 rcu_read_unlock(); 3794 rcu_read_unlock();
3795 3795
3796 css_task_iter_start(&cgrp->dummy_css, &it); 3796 css_task_iter_start(&cgrp->self, &it);
3797 while ((tsk = css_task_iter_next(&it))) { 3797 while ((tsk = css_task_iter_next(&it))) {
3798 switch (tsk->state) { 3798 switch (tsk->state) {
3799 case TASK_RUNNING: 3799 case TASK_RUNNING:
@@ -4274,7 +4274,7 @@ static int cgroup_mkdir(struct kernfs_node *parent_kn, const char *name,
4274 init_cgroup_housekeeping(cgrp); 4274 init_cgroup_housekeeping(cgrp);
4275 4275
4276 cgrp->parent = parent; 4276 cgrp->parent = parent;
4277 cgrp->dummy_css.parent = &parent->dummy_css; 4277 cgrp->self.parent = &parent->self;
4278 cgrp->root = root; 4278 cgrp->root = root;
4279 4279
4280 if (notify_on_release(parent)) 4280 if (notify_on_release(parent))