decrement_for_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… decrement_for_data(9)

okay bestie, buckle up πŸ’– this is one of those pages from the Kernel API Manual (yes, the actual kernel API manual, we're in the big leagues now ✨), and it's all about making a data block's reference count go down. One. Just one. Iconic of it, honestly.


✨ NAME ✨

decrement_for_data β€” decrement the reference count for a data block. that's it, that's the whole job πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int decrement_for_data (struct vdo_slab *slab , struct reference_block
*block , slab_block_number block_number , enum reference_status
old_status , struct reference_updater *updater , vdo_refcount_t
*counter_ptr , bool adjust_block_count );

look at all those parameters, she's high-maintenance and we love that for her πŸ’…


🌸 ARGUMENTS 🌸

okay so every single one of these matters, no skipping, i'm watching you πŸ‘€

  • slab β€” the slab which owns the block. like, the block lives here, this is its home 🏠
  • block β€” the reference block which contains the block being updated. the container of the thing, ykwim?
  • block_number β€” the block to update. which one we're touching, fr fr
  • old_status β€” the reference status of the data block before this decrement. like a "before" pic but for reference status πŸ“Έ
  • updater β€” the reference updater doing this operation, in case we need to look up the pbn lock. yes it's a just-in-case parameter, no i don't make the rules 🫠
  • counter_ptr β€” a pointer to the count for the data block. it's marked (in, out) so it goes in and comes back out, main character energy honestly πŸ‘‘
  • adjust_block_count β€” whether to update the allocator's free block count. bool, so, you know, yes or no bestie ⭐

🌈 RETURN 🌈

VDO_SUCCESS or an error. that's the whole deal β€” slay or sad 😭


πŸ’œ SEE ALSO πŸ’œ

bestie this list is long and i refuse to lose a single one of them, so here's the whole crew 🫢 every name, exactly as it appears:

and the kernel file this whole thing lives in is ./drivers/md/dm-vdo/slab-depot.c β€” go read it, iykyk πŸ’€


πŸŽ€ also, reminder: this page is from the kernel file ./drivers/md/dm-vdo, dated October 2026, and its official title is decrement_for_data(9). periodt. πŸ’…βœ¨πŸ¦‹
πŸ“¦ where this page comes from