shrink_liability(9)
π 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 touchi_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 π
run_gc(9)get_liability(9)make_free_space(9)ubifs_calc_min_idx_lebs(9)ubifs_calc_available(9)can_use_rp(9)do_budget_space(9)calc_idx_growth(9)calc_data_growth(9)calc_dd_growth(9)ubifs_budget_space(9)ubifs_release_budget(9)ubifs_convert_page_budget(9)ubifs_release_dirty_inode_budget(9)ubifs_reported_space(9)ubifs_get_free_space_nolock(9)ubifs_get_free_space(9)
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
- 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