bpf_key_put(9)
π bpf_key_put(9) β it's a Kernel API Manual page, bestie
okay so real talk: this is a page straight out of the Kernel API Manual (section 9, the kernel-functions girlies), and it's about bpf_key_put β the little cleanup gremlin that says bye-bye to a bpf_key for you. No cap, it's short, but it matters. β¨
πΈ NAME πΈ
bpf_key_put β decrement the reference count of the key if that key is valid, and then free the bpf_key itself. that's the whole job. iconic, lowkey.
π SYNOPSIS π
__bpf_kfunc void bpf_key_put (struct bpf_key *bkey );
yes that's the entire signature, she's compact π
and yes, __bpf_kfunc is right there in front, don't forget it.
π¦ ARGUMENTS π¦
bkeyβ abpf_keystructure, aka the thing you're about to release. hand her over, she's done her shift.
β¨ DESCRIPTION β¨
So here's the vibe check π: bpf_key_put decrements the reference count of the key living inside *bkey β but only if that pointer is valid. Then it frees *bkey.
like, if the pointer isn't valid, bestie, no reference count touching happens (obviously, you can't decrement a refcount on nothing π). but the *bkey* free still happens. that's the deal, fr fr β valid key = refcount goes down, then the struct gets freed. πβ‘οΈπ«Ά
ngl, this is a release function β you call it when you're done with a key, not before. it's giving "cleanup era". π§Ήβ¨
π₯ SEE ALSO π₯
all the cousins, all the friends of the family. literally the whole group chat π«Ά:
- Kernel file
./kernel/bpf/helpers.c bpf_obj_new(9)bpf_percpu_obj_new(9)bpf_obj_drop(9)bpf_percpu_obj_drop(9)bpf_refcount_acquire(9)bpf_list_push_front(9)bpf_list_push_back(9)bpf_rbtree_add(9)bpf_task_acquire(9)bpf_task_release(9)bpf_cgroup_acquire(9)bpf_cgroup_release(9)bpf_cgroup_ancestor(9)bpf_cgroup_from_id(9)bpf_task_under_cgroup(9)bpf_task_get_cgroup1(9)bpf_task_from_pid(9)bpf_task_from_vpid(9)bpf_dynptr_slice(9)bpf_dynptr_slice_rdwr(9)bpf_dynptr_copy(9)bpf_dynptr_memset(9)bpf_iter_bits_new(9)bpf_iter_bits_next(9)bpf_iter_bits_destroy(9)bpf_copy_from_user_str(9)bpf_copy_from_user_task_str(9)bpf_strcmp(9)bpf_strcasecmp(9)bpf_strnchr(9)bpf_strchr(9)bpf_strchrnul(9)bpf_strrchr(9)bpf_strnlen(9)bpf_strlen(9)bpf_strspn(9)bpf_strcspn(9)bpf_strstr(9)bpf_strcasestr(9)bpf_strnstr(9)bpf_strncasestr(9)bpf_lookup_user_key(9)bpf_lookup_system_key(9)bpf_verify_pkcs7_signature(9)bpf_task_work_schedule_signal(9)bpf_task_work_schedule_resume(9)bpf_timer_cancel_async(9)
and that's the page!! π huge slay to whoever maintains this one. she comes from ./kernel/bpf and the date on the tin is October 2026 β so like, future-coded of her πβ go forth and free your bpf_keys responsibly, bestie. periodt. π
π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms