mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
cgroup: Avoid extra dereference in css_populate_dir()
Use css directly instead of dereferencing it from &cgroup->self, while adding the cgroup v2 cft base and psi files in css_populate_dir(). Both points to the same css, when css->ss is NULL, this avoids extra deferences and makes code consistent in usage across the function. Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
fd55c0adb4
commit
d24f05987c
1 changed files with 2 additions and 2 deletions
|
@ -1719,13 +1719,13 @@ static int css_populate_dir(struct cgroup_subsys_state *css)
|
|||
|
||||
if (!css->ss) {
|
||||
if (cgroup_on_dfl(cgrp)) {
|
||||
ret = cgroup_addrm_files(&cgrp->self, cgrp,
|
||||
ret = cgroup_addrm_files(css, cgrp,
|
||||
cgroup_base_files, true);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (cgroup_psi_enabled()) {
|
||||
ret = cgroup_addrm_files(&cgrp->self, cgrp,
|
||||
ret = cgroup_addrm_files(css, cgrp,
|
||||
cgroup_psi_files, true);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Reference in a new issue