batadv_hash_remove(9)
π batadv_hash_remove(9) β like, the Kernel API Manual page, bestie π
okay so this is batadv_hash_remove(9) from the Kernel API Manual, and honestly? it's giving "small but mighty". it takes stuff out of a hash table. that's the whole gig. let's get into it β¨
β¨ SYNOPSIS β¨
void * batadv_hash_remove (struct batadv_hashtable *hash ,
batadv_hashdata_compare_cb compare , batadv_hashdata_choose_cb choose ,
void *data );
literally just four things going in, and you get a void * coming back out. we love a function with main character energy π
πΈ ARGUMENTS πΈ
hashβ the hash table. the vibe container. your whole situation lives in here πcompareβ a callback that decides whether two hash elements are identical. like, are you the same person? vibe check π¦chooseβ a callback that calculates the hash index. it picks where things go. the matchmaker of the operation π«dataβ the data you pass to the aforementioned callbacks as an argument. yeah, both of them. it gets handed tocompareandchoose, no cap π«Ά
π DESCRIPTION π
so here's the cute little hack that makes this whole thing work: data can literally be the structure you use with just the key filled in. that's it. that's enough.
we just need the key for comparing β the rest of the struct can be an empty little shell and it's still iconic. no need to fill everything out, bestie, the key is doing all the heavy lifting π
β RETURN β
on success, it returns a pointer to the data β so you get to remove the used structure yourself, main character energy, the cleanup is yours π§
on error? NULL. that's it. NULL means things did not slay π
π SEE ALSO π
Kernel file ./net/batman-adv/hash.h β go read it, iykyk
batadv_hashdata_compare_cb(9)batadv_hashdata_choose_cb(9)batadv_hashdata_free_cb(9)struct batadv_hashtable(9)batadv_hash_add(9)
and that's the page!! mwah π huge shoutout to ./net/batman-adv for bringing us this banger, dated October 2026 β mark your calendars, 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