mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-08 15:04:45 +00:00
bpf: cgroup_iter: support cgroup1 using cgroup fd
Use cgroup_v1v2_get_from_fd() in cgroup_iter to support attaching to both cgroup v1 and v2 using fds. Signed-off-by: Yosry Ahmed <yosryahmed@google.com> Acked-by: Martin KaFai Lau <martin.lau@kernel.org> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
a6d1ce5951
commit
35256d673a
@ -196,7 +196,7 @@ static int bpf_iter_attach_cgroup(struct bpf_prog *prog,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (fd)
|
if (fd)
|
||||||
cgrp = cgroup_get_from_fd(fd);
|
cgrp = cgroup_v1v2_get_from_fd(fd);
|
||||||
else if (id)
|
else if (id)
|
||||||
cgrp = cgroup_get_from_id(id);
|
cgrp = cgroup_get_from_id(id);
|
||||||
else /* walk the entire hierarchy by default. */
|
else /* walk the entire hierarchy by default. */
|
||||||
|
Loading…
Reference in New Issue
Block a user