perf/cgroup: use the cgroup_id() helper
From: Barret Rhoden
Date: Fri Apr 03 2020 - 14:08:16 EST
We had a few places that still used cgrp->kn->id instead of cgroup_id().
Signed-off-by: Barret Rhoden <brho@xxxxxxxxxx>
---
kernel/events/core.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 318435c5bf0b..e5deab0e7185 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -1594,7 +1594,8 @@ perf_event_groups_less(struct perf_event *left, struct perf_event *right)
return false;
}
/* Two dissimilar cgroups, order by id. */
- if (left->cgrp->css.cgroup->kn->id < right->cgrp->css.cgroup->kn->id)
+ if (cgroup_id(left->cgrp->css.cgroup) <
+ cgroup_id(right->cgrp->css.cgroup))
return true;
return false;
@@ -1692,7 +1693,7 @@ perf_event_groups_first(struct perf_event_groups *groups, int cpu,
u64 node_cgrp_id, cgrp_id = 0;
if (cgrp)
- cgrp_id = cgrp->kn->id;
+ cgrp_id = cgroup_id(cgrp);
#endif
while (node) {
@@ -1709,7 +1710,7 @@ perf_event_groups_first(struct perf_event_groups *groups, int cpu,
#ifdef CONFIG_CGROUP_PERF
node_cgrp_id = 0;
if (node_event->cgrp && node_event->cgrp->css.cgroup)
- node_cgrp_id = node_event->cgrp->css.cgroup->kn->id;
+ node_cgrp_id = cgroup_id(node_event->cgrp->css.cgroup);
if (cgrp_id < node_cgrp_id) {
node = node->rb_left;
@@ -1745,10 +1746,10 @@ perf_event_groups_next(struct perf_event *event)
#ifdef CONFIG_CGROUP_PERF
if (event->cgrp && event->cgrp->css.cgroup)
- curr_cgrp_id = event->cgrp->css.cgroup->kn->id;
+ curr_cgrp_id = cgroup_id(event->cgrp->css.cgroup);
if (next->cgrp && next->cgrp->css.cgroup)
- next_cgrp_id = next->cgrp->css.cgroup->kn->id;
+ next_cgrp_id = cgroup_id(next->cgrp->css.cgroup);
if (curr_cgrp_id != next_cgrp_id)
return NULL;
--
2.26.0.292.g33ef6b2f38-goog