shrink_liability(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… shrink_liability(9) β€” a Kernel API Manual moment

okay so you found the shrink_liability page in the Kernel API Manual, and honestly? iconic. it's a tiny little function that does one very specific vibe: it writes back dirty stuff so UBIFS stops being so stressed. let's get into it 🫢


✨ NAME ✨

shrink_liability β€” write-back some dirty pages/inodes.

like, that's it. that's the whole job. she writes stuff back. πŸ’…


🌸 SYNOPSIS 🌸

void shrink_liability (struct ubifs_info *c , int nr_to_write );

literally returns nothing (void), takes two things, and yes bestie the spacing is exactly like that, don't @ me 😭


πŸŽ€ ARGUMENTS πŸŽ€

  • c β€” the UBIFS file-system description object. it's the whole file system's little info blob, she needs it to know what she's working with πŸ¦‹
  • nr_to_write β€” how many dirty pages to write-back. that's the number, that's the budget of pages, go off πŸ‘‘

πŸ”₯ DESCRIPTION πŸ”₯

so. this function shrinks UBIFS liability by means of writing back some amount of dirty inodes and their pages. that's the whole slay. less liability, more written-back content, everyone breathes easier ✨

⚠️ important note, no cap: this function synchronizes even VFS inodes which are locked (i_mutex) by the caller of the budgeting function. why is that allowed? because write-back does not touch i_mutex. so she's out here casually handling locked inodes and it's fine. it's fine!! πŸ˜­πŸ’–

like yes, that sounds slightly cursed, but that's genuinely the documented behaviour, so we're not gonna pretend otherwise πŸ™ˆ


🌈 SEE ALSO 🌈

kernel file ./fs/ubifs/budget.c β€” and here's the whole friend group, all 17 of them, in order, because I would never do them dirty by skipping anyone πŸ’œ


aaaand that's the page πŸŽ€ she lives in ./fs/ubifs, the source/version is ./fs/ubifs, and this cutie is dated October 2026. mwah, go read the other budget functions bestie, they're all in the same friend group πŸ’–βœ¨

πŸ“¦ where this page comes from