cgroup: merge cft_release_agent cftype array into the base files array
Now that cftype can express whether a file should only be on root, cft_release_agent can be merged into the base files cftypes array. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizf@cn.fujitsu.com>
This commit is contained in:
parent
8e3f6541d4
commit
6e6ff25bd5
@ -3732,13 +3732,13 @@ static struct cftype files[] = {
|
|||||||
.read_u64 = cgroup_clone_children_read,
|
.read_u64 = cgroup_clone_children_read,
|
||||||
.write_u64 = cgroup_clone_children_write,
|
.write_u64 = cgroup_clone_children_write,
|
||||||
},
|
},
|
||||||
};
|
{
|
||||||
|
.name = "release_agent",
|
||||||
static struct cftype cft_release_agent = {
|
.flags = CFTYPE_ONLY_ON_ROOT,
|
||||||
.name = "release_agent",
|
.read_seq_string = cgroup_release_agent_show,
|
||||||
.read_seq_string = cgroup_release_agent_show,
|
.write_string = cgroup_release_agent_write,
|
||||||
.write_string = cgroup_release_agent_write,
|
.max_write_len = PATH_MAX,
|
||||||
.max_write_len = PATH_MAX,
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static int cgroup_populate_dir(struct cgroup *cgrp)
|
static int cgroup_populate_dir(struct cgroup *cgrp)
|
||||||
@ -3750,11 +3750,6 @@ static int cgroup_populate_dir(struct cgroup *cgrp)
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
if (cgrp == cgrp->top_cgroup) {
|
|
||||||
if ((err = cgroup_add_file(cgrp, NULL, &cft_release_agent)) < 0)
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* process cftsets of each subsystem */
|
/* process cftsets of each subsystem */
|
||||||
for_each_subsys(cgrp->root, ss) {
|
for_each_subsys(cgrp->root, ss) {
|
||||||
struct cftype_set *set;
|
struct cftype_set *set;
|
||||||
|
Loading…
Reference in New Issue
Block a user