bpf_cgroup_ancestor(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– bpf_cgroup_ancestor(9) β€” the Kernel API Manual page, but make it make sense ✨

okay so bestie, welcome to bpf_cgroup_ancestor(9), straight out of the Kernel API Manual πŸ’… this little icon does a lookup on an entry in a cgroup's ancestor array β€” yes, that's the whole vibe. and like, super important: a cgroup that this kfunc hands back to you, if you're not gonna immediately store it in a map, must be released by calling bpf_cgroup_release(). no cap, don't just ghost it 😭


🌸 SYNOPSIS 🌸

__bpf_kfunc struct cgroup * bpf_cgroup_ancestor (struct cgroup *cgrp ,
int level );

look at her. iconic signature. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • cgrp β€” the cgroup we're performing a lookup on. like, the one you're being nosy about πŸ‘€
  • level β€” the level of ancestor to look up. which generation of the family tree you want, bestie 🌈

⭐ SEE ALSO ⭐

everything in the group chat, fr fr β€” Kernel file ./kernel/bpf/helpers.c and all her besties:

like, the whole friend group showed up 🫢

⚠️ reminder one more time because I care about you: if you get a cgroup back from this kfunc and you do not store it in a map, you must call bpf_cgroup_release() on it. memory leaks are not the vibe, bestie πŸ’€

kisses from the kernel πŸ’œ this page lives in ./kernel/bpf, drops in October 2026, and yeah β€” it's bpf_cgroup_ancestor(9), that's her name, don't wear it out πŸ’…βœ¨

πŸ“¦ where this page comes from