]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
cgroup: reorganize cgroup_create()
authorTejun Heo <tj@kernel.org>
Tue, 13 May 2014 16:19:22 +0000 (12:19 -0400)
committerTejun Heo <tj@kernel.org>
Tue, 13 May 2014 16:19:22 +0000 (12:19 -0400)
commitba0f4d761503bd9ce4c7458b56bfd7c3fdb51e86
treec040ae2a79cbf8fcb36898f2f3b5926032df1738
parentb7fc5ad235936379fae67a9f7b50bb53487a1a3a
cgroup: reorganize cgroup_create()

Reorganize cgroup_create() so that all paths share unlock out path.

* All err_* labels are renamed to out_* as they're now shared by both
  success and failure paths.

* @err renamed to @ret for the similar reason as above and so that
  it's more consistent with other functions.

* cgroup memory allocation moved after locking so that freeing failed
  cgroup happens before unlocking.  While this moves more code inside
  critical section, memory allocations inside cgroup locking are
  already pretty common and this is unlikely to make any noticeable
  difference.

* While at it, replace a stray @parent->root dereference with @root.

This reorganization will help simplifying locking.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
kernel/cgroup.c