diff options
| author | JP Kobryn <inwardvessel@gmail.com> | 2025-04-03 18:10:47 -0700 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2025-04-04 10:01:22 -1000 |
| commit | 845a7245801142bfff411bc84afa8cdbc789562f (patch) | |
| tree | 3716896b30a44aef7389d5551c68dccd5d3e7111 /kernel/cgroup | |
| parent | cgroup: move rstat base stat objects into their own struct (diff) | |
| download | linux-845a7245801142bfff411bc84afa8cdbc789562f.tar.gz linux-845a7245801142bfff411bc84afa8cdbc789562f.zip | |
cgroup: add helper for checking when css is cgroup::self
The cgroup struct has a css field called "self". The main difference
between this css and the others found in the cgroup::subsys array is that
cgroup::self has a NULL subsystem pointer. There are several places where
checks are performed to determine whether the css in question is
cgroup::self or not. Instead of accessing css->ss directly, introduce a
helper function that shows the intent and use where applicable.
Signed-off-by: JP Kobryn <inwardvessel@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup')
| -rw-r--r-- | kernel/cgroup/cgroup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index e1f0284cbbb8..d98994b106ed 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -1706,7 +1706,7 @@ static void css_clear_dir(struct cgroup_subsys_state *css) css->flags &= ~CSS_VISIBLE; - if (!css->ss) { + if (css_is_cgroup(css)) { if (cgroup_on_dfl(cgrp)) { cgroup_addrm_files(css, cgrp, cgroup_base_files, false); @@ -1738,7 +1738,7 @@ static int css_populate_dir(struct cgroup_subsys_state *css) if (css->flags & CSS_VISIBLE) return 0; - if (!css->ss) { + if (css_is_cgroup(css)) { if (cgroup_on_dfl(cgrp)) { ret = cgroup_addrm_files(css, cgrp, cgroup_base_files, true); |
