cgroup: replace cftype->write_string() with 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)
commit451af504df0c62f695a69b83c250486e77c66378
treef89879cf3f88e9da346d8bd3fa1ae192a280d772
parentb41686401e501430ffe93b575ef7959d2ecc6f2e
cgroup: replace cftype->write_string() with cftype->write()

Convert all cftype->write_string() users to the new cftype->write()
which maps directly to kernfs write operation and has full access to
kernfs and cgroup contexts.  The conversions are mostly mechanical.

* @css and @cft are accessed using of_css() and of_cft() accessors
  respectively instead of being specified as arguments.

* Should return @nbytes on success instead of 0.

* @buf is not trimmed automatically.  Trim if necessary.  Note that
  blkcg and netprio don't need this as the parsers already handle
  whitespaces.

cftype->write_string() has no user left after the conversions and
removed.

While at it, remove unnecessary local variable @p in
cgroup_subtree_control_write() and stale comment about
CGROUP_LOCAL_BUFFER_SIZE in cgroup_freezer.c.

This patch doesn't introduce any visible behavior changes.

v2: netprio was missing from conversion.  Converted.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Aristeu Rozanski <arozansk@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Li Zefan <lizefan@huawei.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: "David S. Miller" <davem@davemloft.net>
block/blk-throttle.c
block/cfq-iosched.c
include/linux/cgroup.h
kernel/cgroup.c
kernel/cgroup_freezer.c
kernel/cpuset.c
mm/hugetlb_cgroup.c
mm/memcontrol.c
net/core/netprio_cgroup.c
net/ipv4/tcp_memcontrol.c
security/device_cgroup.c