cgroup: reorganize cgroup.procs / task write path
authorTejun Heo <tj@kernel.org>
Mon, 15 May 2017 13:34:00 +0000 (09:34 -0400)
committerTejun Heo <tj@kernel.org>
Fri, 21 Jul 2017 15:14:50 +0000 (11:14 -0400)
commit715c809d9a9e38d8fb9476757ddaf64c1a9f767f
treea512006adfbfa1d50675b25f2342e0c8e47061bf
parent27f26753f8c063c4cd2f06318e977ae136574b28
cgroup: reorganize cgroup.procs / task write path

Currently, writes "cgroup.procs" and "cgroup.tasks" files are all
handled by __cgroup_procs_write() on both v1 and v2.  This patch
reoragnizes the write path so that there are common helper functions
that different write paths use.

While this somewhat increases LOC, the different paths are no longer
intertwined and each path has more flexibility to implement different
behaviors which will be necessary for the planned v2 thread support.

v3: - Restructured so that cgroup_procs_write_permission() takes
      @src_cgrp and @dst_cgrp.

v2: - Rolled in Waiman's task reference count fix.
    - Updated on top of nsdelegate changes.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Waiman Long <longman@redhat.com>
kernel/cgroup/cgroup-internal.h
kernel/cgroup/cgroup-v1.c
kernel/cgroup/cgroup.c