History

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.

Tejun Heo committed 14 years ago

Commit 6e6ff251 parent 8e3f6541 file · +7 −12Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/cgroup.c+7−12
@@ -3732,13 +3732,13 @@ static struct cftype files[] = { · 3731 unmodified lines
37323732 .read_u64 = cgroup_clone_children_read,
37333733 .write_u64 = cgroup_clone_children_write,
37343734 },
3735−};
3736−
3737−static struct cftype cft_release_agent = {
3738− .name = "release_agent",
3739− .read_seq_string = cgroup_release_agent_show,
3740− .write_string = cgroup_release_agent_write,
3741− .max_write_len = PATH_MAX,
3735+ {
3736+ .name = "release_agent",
3737+ .flags = CFTYPE_ONLY_ON_ROOT,
3738+ .read_seq_string = cgroup_release_agent_show,
3739+ .write_string = cgroup_release_agent_write,
3740+ .max_write_len = PATH_MAX,
3741+ },
37423742 };
37433743
37443744 static int cgroup_populate_dir(struct cgroup *cgrp)
@@ -3750,11 +3750,6 @@ static int cgroup_populate_dir(struct cgroup *cgrp) · 5 unmodified lines
37503750 if (err < 0)
37513751 return err;
37523752
3753− if (cgrp == cgrp->top_cgroup) {
3754− if ((err = cgroup_add_file(cgrp, NULL, &cft_release_agent)) < 0)
3755− return err;
3756− }
3757−
37583753 /* process cftsets of each subsystem */
37593754 for_each_subsys(cgrp->root, ss) {
37603755 struct cftype_set *set;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t