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>
Showing
- block/blk-throttle.c 16 additions, 16 deletionsblock/blk-throttle.c
- block/cfq-iosched.c 14 additions, 14 deletionsblock/cfq-iosched.c
- include/linux/cgroup.h 1 addition, 9 deletionsinclude/linux/cgroup.h
- kernel/cgroup.c 19 additions, 19 deletionskernel/cgroup.c
- kernel/cgroup_freezer.c 9 additions, 11 deletionskernel/cgroup_freezer.c
- kernel/cpuset.c 9 additions, 7 deletionskernel/cpuset.c
- mm/hugetlb_cgroup.c 9 additions, 8 deletionsmm/hugetlb_cgroup.c
- mm/memcontrol.c 25 additions, 21 deletionsmm/memcontrol.c
- net/core/netprio_cgroup.c 6 additions, 6 deletionsnet/core/netprio_cgroup.c
- net/ipv4/tcp_memcontrol.c 9 additions, 7 deletionsnet/ipv4/tcp_memcontrol.c
- security/device_cgroup.c 7 additions, 7 deletionssecurity/device_cgroup.c
Loading
Please register or sign in to comment