vdo_int_map_put(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– vdo_int_map_put(9) πŸ’–

okay so real talk, this is a page straight out of the Kernel API Manual β€” yes, that Kernel API Manual β€” and it's all about vdo_int_map_put. Buckle up bestie, we're mapping integers to values and it's gonna slay. 🌸


✨ NAME ✨

vdo_int_map_put β€” try to associate a value with an integer. that's it. that's the whole vibe. πŸŽ€


🌈 SYNOPSIS 🌈

int vdo_int_map_put (struct int_map *map , u64 key , void *new_value ,
bool update , void **old_value_ptr );

look at her. five args. main character energy fr. πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • map β€” the int_map you're trying to modify. she's the one getting the glow-up. πŸ’…
  • key β€” the key you wanna associate the new value with. like, this is the lock and the value is the key but also the key is the key. iykyk. πŸ”‘
  • new_value β€” the value that's getting associated with the key. the new kid. the fresh face. 🌟
  • update β€” whether to overwrite an existing value. like, do we barge in and redecorate, or do we respect what's already there? true = barge in. 😀
  • old_value_ptr β€” a pointer where you stash either the old value (if the key was already mapped) or NULL if the map didn't contain the key. and here's the cute part: you can pass NULL for this whole thing if you literally do not care about the old value. not me being unbothered. πŸ™ˆ

πŸ’œ DESCRIPTION πŸ’œ

So the mission β€” should you choose to accept it β€” is to try to associate a value (a pointer, babe, it's a pointer) with an integer in an int_map. 🫢

If the map already contains a mapping for the provided key, the old value only gets replaced with the specified value if update is true. Otherwise the old one just sits there, unbothered, thriving. πŸ’€

And in either case, the old value is returned. every single time. no exceptions, no cap. πŸ’―

But if the map does not already contain a value for the specified key? then the new value gets added regardless of the value of update. like update doesn't even get a vote in that situation. she's irrelevant. iconic. πŸ”₯


⭐ RETURN ⭐

VDO_SUCCESS or an error code. that's the whole return section. short and sweet, just how we like it. ✨


🧚 SEE ALSO 🧚

Kernel file ./drivers/md/dm-vdo/int-map.c β€” go read the source, bestie, it's giving lore. πŸ“–

literally the whole friend group. go say hi. πŸ‘‹πŸ’–


okay and finally, the credits moment β€” this page lives in ./drivers/md/dm-vdo, dated October 2026, and it's page vdo_int_map_put(9) of the Kernel API Manual. mwah. πŸ’‹ thanks for coming to my ted talk, go map some integers responsibly. πŸ“πŸŒˆ

πŸ“¦ where this page comes from