]> git.baikalelectronics.ru Git - 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)
commitf3615c6b83b20abf8d659719028178e28009a4ec
treec040ae2a79cbf8fcb36898f2f3b5926032df1738
parent00d68e51496c19d9dcda7b860df02dfbbdccea60
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