Now that cgroup_subtree_control_write() has access to the associated
kernfs_open_file and thus the kernfs_node, there's no need to cache it
in cgroup->control_kn on creation. Remove cgroup->control_kn and use
@of->kn directly.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
struct cgroup *parent; /* my parent */
struct kernfs_node *kn; /* cgroup kernfs entry */
- struct kernfs_node *control_kn; /* kn for "cgroup.subtree_control" */
struct kernfs_node *populated_kn; /* kn for "cgroup.subtree_populated" */
/*
* active_ref protection.
*/
cgroup_get(cgrp);
- kernfs_break_active_protection(cgrp->control_kn);
+ kernfs_break_active_protection(of->kn);
mutex_lock(&cgroup_tree_mutex);
out_unlock_tree:
mutex_unlock(&cgroup_tree_mutex);
out_unbreak:
- kernfs_unbreak_active_protection(cgrp->control_kn);
+ kernfs_unbreak_active_protection(of->kn);
cgroup_put(cgrp);
return ret ?: nbytes;
return ret;
}
- if (cft->seq_show == cgroup_subtree_control_show)
- cgrp->control_kn = kn;
- else if (cft->seq_show == cgroup_populated_show)
+ if (cft->seq_show == cgroup_populated_show)
cgrp->populated_kn = kn;
return 0;
}