• Tejun Heo's avatar
    cgroup: restructure file creation / removal handling · 4df8dc90
    Tejun Heo authored
    The file creation / removal path has always been a bit icky and the
    planned notification update requires css during file creation.
    Restructure as follows.
    
    * cgroup_addrm_files() now takes both @css and @cgrp and is only
      called directly by other file handling functions.
    
    * cgroup_populate/clear_dir() are replaced with
      css_populate/clear_dir() taking @css and @cgrp_override.
      @cgrp_override is used only when files needs to be created on /
      removed from a cgroup which isn't attached to @css which happens
      during subsystem rebinds.  Subsystem loops are moved to the callers.
    
    * cgroup_add_file() now takes both @css and @cgrp.  @css isn't used
      yet but will be used by the planned notification update.
    
    This patch doens't cause any behavior changes.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Cc: Li Zefan <lizefan@huawei.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    4df8dc90
cgroup.c 156 KB