提交 aec25020 编写于 作者: T Tejun Heo

cgroup: rename cgroup_subsys->subsys_id to ->id

It's no longer referenced outside cgroup core, so renaming is easy.
Let's rename it for consistency & brevity.

This patch is pure rename.
Signed-off-by: NTejun Heo <tj@kernel.org>
Acked-by: NLi Zefan <lizefan@huawei.com>
上级 073219e9
...@@ -548,7 +548,7 @@ int cgroup_taskset_size(struct cgroup_taskset *tset); ...@@ -548,7 +548,7 @@ int cgroup_taskset_size(struct cgroup_taskset *tset);
(task) = cgroup_taskset_next((tset))) \ (task) = cgroup_taskset_next((tset))) \
if (!(skip_css) || \ if (!(skip_css) || \
cgroup_taskset_cur_css((tset), \ cgroup_taskset_cur_css((tset), \
(skip_css)->ss->subsys_id) != (skip_css)) (skip_css)->ss->id) != (skip_css))
/* /*
* Control Group subsystem type. * Control Group subsystem type.
...@@ -592,7 +592,7 @@ struct cgroup_subsys { ...@@ -592,7 +592,7 @@ struct cgroup_subsys {
bool warned_broken_hierarchy; bool warned_broken_hierarchy;
/* the following two fields are initialized automtically during boot */ /* the following two fields are initialized automtically during boot */
int subsys_id; int id;
#define MAX_CGROUP_TYPE_NAMELEN 32 #define MAX_CGROUP_TYPE_NAMELEN 32
const char *name; const char *name;
......
...@@ -198,7 +198,7 @@ static struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp, ...@@ -198,7 +198,7 @@ static struct cgroup_subsys_state *cgroup_css(struct cgroup *cgrp,
struct cgroup_subsys *ss) struct cgroup_subsys *ss)
{ {
if (ss) if (ss)
return rcu_dereference_check(cgrp->subsys[ss->subsys_id], return rcu_dereference_check(cgrp->subsys[ss->id],
lockdep_is_held(&cgroup_mutex)); lockdep_is_held(&cgroup_mutex));
else else
return &cgrp->dummy_css; return &cgrp->dummy_css;
...@@ -3982,7 +3982,7 @@ static void css_release(struct percpu_ref *ref) ...@@ -3982,7 +3982,7 @@ static void css_release(struct percpu_ref *ref)
struct cgroup_subsys_state *css = struct cgroup_subsys_state *css =
container_of(ref, struct cgroup_subsys_state, refcnt); container_of(ref, struct cgroup_subsys_state, refcnt);
rcu_assign_pointer(css->cgroup->subsys[css->ss->subsys_id], NULL); rcu_assign_pointer(css->cgroup->subsys[css->ss->id], NULL);
call_rcu(&css->rcu_head, css_free_rcu_fn); call_rcu(&css->rcu_head, css_free_rcu_fn);
} }
...@@ -4014,7 +4014,7 @@ static int online_css(struct cgroup_subsys_state *css) ...@@ -4014,7 +4014,7 @@ static int online_css(struct cgroup_subsys_state *css)
if (!ret) { if (!ret) {
css->flags |= CSS_ONLINE; css->flags |= CSS_ONLINE;
css->cgroup->nr_css++; css->cgroup->nr_css++;
rcu_assign_pointer(css->cgroup->subsys[ss->subsys_id], css); rcu_assign_pointer(css->cgroup->subsys[ss->id], css);
} }
return ret; return ret;
} }
...@@ -4034,7 +4034,7 @@ static void offline_css(struct cgroup_subsys_state *css) ...@@ -4034,7 +4034,7 @@ static void offline_css(struct cgroup_subsys_state *css)
css->flags &= ~CSS_ONLINE; css->flags &= ~CSS_ONLINE;
css->cgroup->nr_css--; css->cgroup->nr_css--;
RCU_INIT_POINTER(css->cgroup->subsys[ss->subsys_id], css); RCU_INIT_POINTER(css->cgroup->subsys[ss->id], css);
} }
/** /**
...@@ -4065,7 +4065,7 @@ static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss) ...@@ -4065,7 +4065,7 @@ static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss)
init_css(css, ss, cgrp); init_css(css, ss, cgrp);
err = cgroup_populate_dir(cgrp, 1 << ss->subsys_id); err = cgroup_populate_dir(cgrp, 1 << ss->id);
if (err) if (err)
goto err_free; goto err_free;
...@@ -4292,7 +4292,7 @@ static void css_killed_ref_fn(struct percpu_ref *ref) ...@@ -4292,7 +4292,7 @@ static void css_killed_ref_fn(struct percpu_ref *ref)
*/ */
static void kill_css(struct cgroup_subsys_state *css) static void kill_css(struct cgroup_subsys_state *css)
{ {
cgroup_clear_dir(css->cgroup, 1 << css->ss->subsys_id); cgroup_clear_dir(css->cgroup, 1 << css->ss->id);
/* /*
* Killing would put the base ref, but we need to keep it alive * Killing would put the base ref, but we need to keep it alive
...@@ -4496,7 +4496,7 @@ static void __init cgroup_init_subsys(struct cgroup_subsys *ss) ...@@ -4496,7 +4496,7 @@ static void __init cgroup_init_subsys(struct cgroup_subsys *ss)
* pointer to this state - since the subsystem is * pointer to this state - since the subsystem is
* newly registered, all tasks and hence the * newly registered, all tasks and hence the
* init_css_set is in the subsystem's top cgroup. */ * init_css_set is in the subsystem's top cgroup. */
init_css_set.subsys[ss->subsys_id] = css; init_css_set.subsys[ss->id] = css;
need_forkexit_callback |= ss->fork || ss->exit; need_forkexit_callback |= ss->fork || ss->exit;
...@@ -4536,14 +4536,14 @@ int __init cgroup_init_early(void) ...@@ -4536,14 +4536,14 @@ int __init cgroup_init_early(void)
list_add(&init_cgrp_cset_link.cgrp_link, &init_css_set.cgrp_links); list_add(&init_cgrp_cset_link.cgrp_link, &init_css_set.cgrp_links);
for_each_subsys(ss, i) { for_each_subsys(ss, i) {
WARN(!ss->css_alloc || !ss->css_free || ss->name || ss->subsys_id, WARN(!ss->css_alloc || !ss->css_free || ss->name || ss->id,
"invalid cgroup_subsys %d:%s css_alloc=%p css_free=%p name:id=%d:%s\n", "invalid cgroup_subsys %d:%s css_alloc=%p css_free=%p name:id=%d:%s\n",
i, cgroup_subsys_name[i], ss->css_alloc, ss->css_free, i, cgroup_subsys_name[i], ss->css_alloc, ss->css_free,
ss->subsys_id, ss->name); ss->id, ss->name);
WARN(strlen(cgroup_subsys_name[i]) > MAX_CGROUP_TYPE_NAMELEN, WARN(strlen(cgroup_subsys_name[i]) > MAX_CGROUP_TYPE_NAMELEN,
"cgroup_subsys_name %s too long\n", cgroup_subsys_name[i]); "cgroup_subsys_name %s too long\n", cgroup_subsys_name[i]);
ss->subsys_id = i; ss->id = i;
ss->name = cgroup_subsys_name[i]; ss->name = cgroup_subsys_name[i];
if (ss->early_init) if (ss->early_init)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册