]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
cgroup: implement cftype->write()
authorTejun Heo <tj@kernel.org>
Tue, 13 May 2014 16:16:21 +0000 (12:16 -0400)
committerTejun Heo <tj@kernel.org>
Tue, 13 May 2014 16:16:21 +0000 (12:16 -0400)
commitb41686401e501430ffe93b575ef7959d2ecc6f2e
tree9d38bb6b2878c3107aaad43ab53ac145c4ed9a9e
parentec903c0c858e4963a9e0724bdcadfa837253341c
cgroup: implement cftype->write()

During the recent conversion to kernfs, cftype's seq_file operations
are updated so that they are directly mapped to kernfs operations and
thus can fully access the associated kernfs and cgroup contexts;
however, write path hasn't seen similar updates and none of the
existing write operations has access to, for example, the associated
kernfs_open_file.

Let's introduce a new operation cftype->write() which maps directly to
the kernfs write operation and has access to all the arguments and
contexts.  This will replace ->write_string() and ->trigger() and ease
manipulation of kernfs active protection from cgroup file operations.

Two accessors - of_cft() and of_css() - are introduced to enable
accessing the associated cgroup context from cftype->write() which
only takes kernfs_open_file for the context information.  The
accessors for seq_file operations - seq_cft() and seq_css() - are
rewritten to wrap the of_ accessors.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
include/linux/cgroup.h
kernel/cgroup.c