get_hashentry(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… get_hashentry β€” the Kernel API Manual, bestie edition ✨

okay so this one's from the Kernel API Manual, and it's lowkey one of those tiny helper functions that eats and leaves no crumbs. let's get into it 🫢


🌸 NAME 🌸

get_hashentry β€” literally just a wrapper around a hashtable lookup. that's the whole vibe. it looks things up, and if the thing isn't there, it makes room for it. iconic behavior honestly πŸ‘‘


✨ SYNOPSIS ✨

void * get_hashentry (struct rhashtable *ht , void *key , const struct
rhashtable_params params , size_t size );

yes bestie, it returns a void *. we love a flexible pointer πŸ’–


πŸŽ€ ARGUMENTS πŸŽ€

  • ht β€” the hashtable where the entry could be found. this is the group chat you're searching through πŸ”
  • key β€” the key to look up. the thing you're matching on, the actual search term, the @ you're trying to find πŸ’…
  • params β€” the hashtable params. it's a const struct rhashtable_params, so it's giving "look but don't touch" πŸ¦‹
  • size β€” the size of the entry to allocate if it's not in the table. so if the search comes up empty, this is how much memory we're setting aside for the new one 🌱

πŸ’€ DESCRIPTION πŸ’€

so here's the tea: this function returns an entry from a hashtable. simple enough, right?

but if the entry does not exist yet, it allocates the memory for it and returns the new entry. not me showing up, not finding what i wanted, and just making it exist 😭✨ main character energy fr fr.

so yeah β€” lookup first, allocate if missing, hand you back the entry either way. no cap 🧚


🌈 SEE ALSO 🌈

  • the kernel file ./drivers/net/ethernet/netronome/nfp/flower/conntrack.c β€” go read it, iykyk πŸ“–
  • get_mangled_key(9) β€” its little friend, also worth a vibe check πŸ’œ

ngl if you're poking around in kernel hashtables, keep an eye on memory stuff β€” the whole "allocate if it's not there" thing is the moment of the page, so know that it's happening πŸ”₯

that's the whole page, bestie!! this absolute gem of a man page is hanging out in the Linux kernel sources β€” the footer points at ./drivers/net/ethernet/netrono... and it's dated October 2026, page name get_hashentry(9). slay, go read some kernel code, mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from