STRUCT RHASHTABLE_PARAMS(9)
π struct rhashtable_params(9) π
okay so bestie, welcome to struct rhashtable_params(9), fresh out of the Kernel API Manual β¨ this is the little config struct you hand over when you're building a hash table, and honestly it's giving "main character energy" for the whole rhashtable situation π
πΈ NAME πΈ
struct rhashtable_params β Hash table construction parameters π
β¨ SYNOPSIS β¨
struct rhashtable_params {
u16 nelem_hint;
u16 key_len;
u16 key_offset;
u16 head_offset;
unsigned int max_size;
u16 min_size;
bool insecure_elasticity;
bool automatic_shrinking;
rht_hashfn_t hashfn;
rht_obj_hashfn_t obj_hashfn;
rht_obj_cmpfn_t obj_cmpfn;
};
like, that's the whole vibe right there π«Ά
π§© Members π§©
okay now the part you actually came for, member by member, no cap π₯
nelem_hintβ a hint about how many elements you're expecting π it should be 75% of desired size, so don't just yeet the full number in there, okay? πkey_lenβ the length of the key πkey_offsetβ the offset of the key inside the struct that's gonna get hashed πhead_offsetβ the offset ofrhash_headinside the struct that's gonna get hashed π―max_sizeβ the maximum size while expanding πmin_sizeβ the minimum size while shrinking π (yes they're a matching set, we love symmetry π)insecure_elasticityβ set totrueto disable chain length checks β οΈ bestie, the name is literally telling you it's insecure, so proceed with intention, fr fr πhashfnβ the hash function π§ default isjhash2if!(key_len % 4), orjhashβ that's the whole conditional, no notes β¨obj_hashfnβ function to hash the object πobj_cmpfnβ function to compare a key with an object π
π SEE ALSO π
go read these next, iykwup (you know what's up, bestie) π
- Kernel file
./include/linux/rhashtable-types.hstructrhashtable_compare_arg(9),struct rhashtable(9),struct rhltable(9),struct rhashtable_walker(9),struct rhashtable_iter(9)π
π lowkey important reminder: insecure_elasticity disables chain length checks. that's a real security thing, not a cute vibe. don't say i didn't warn you π«Ά
and that's the page, bestie!! no crumbs left πΈ this little icon came from the kernel tree at ./include/linux, dated October 2026, and it's filed under struct rhashtable_params(9) β slay, go build a hash table, 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