]> git.baikalelectronics.ru Git - 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)
commitf08d4a887ba3abd6dd135805d521ceec17e9b11d
tree9d38bb6b2878c3107aaad43ab53ac145c4ed9a9e
parent1c555478e6b3d41b6458e7a329790665d1c829ec
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