update_mapping(9)
π NAME π
Okay so bestie, welcome to update_mapping(9) from the Kernel API Manual β¨. This function is literally here to find and update any existing mapping for a given key, and it returns the value associated with the key in the pointer you provide. Iconic. π
β¨ SYNOPSIS β¨
bool update_mapping (struct bucket *neighborhood , u64 key , void
*new_value , bool update , void **old_value_ptr );
π ARGUMENTS π
Here's the cast, no cap:
neighborhoodβ the first bucket in the neighborhood that would contain the search key. That's the whole vibe for this one.keyβ the key you're associating the new value with.new_valueβ the value to be associated with the key.updateβ whether to overwrite an existing value. Yes, that's the question this one answers, periodt.old_value_ptrβ a pointer in which to store the old value (unmodified if no mapping was found). Important: it stays unmodified if no mapping was found.
πΈ RETURN πΈ
It returns true if the map contains a mapping for the key, and false if it does not. That's the vibe check: true = mapping exists, false = it does not. π«Ά
π¦ SEE ALSO π¦
Go stalk these next, bestie:
- Kernel file
./drivers/md/dm-vdo/int-map.c Introduction(9)struct bucket(9)struct int_map(9)mix(9)hash_key(9)allocate_buckets(9)vdo_int_map_create(9)vdo_int_map_free(9)vdo_int_map_size(9)dereference_hop(9)insert_in_hop_list(9)select_bucket(9)search_hop_list(9)vdo_int_map_get(9)resize_buckets(9)find_empty_bucket(9)move_empty_bucket(9)find_or_make_vacancy(9)vdo_int_map_put(9)vdo_int_map_remove(9)
mwah π β source/version: ./drivers/md/dm-vdo, dated October 2026, and this cutie is update_mapping(9). π
π¦ 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