make_free_space(9)
π make_free_space(9) β from the Kernel API Manual, bestie π
okay so this is a page straight out of the Kernel API Manual (that's the manual name, iykyk) and it's about a little function called make_free_space that does exactly what it says on the tin: it makes more free space on the file-system. no cap. β¨
πΈ NAME πΈ
make_free_space β make more free space on the file-system. that's it, that's the whole vibe π
π SYNOPSIS π
int make_free_space (struct ubifs_info *c );
π¦ ARGUMENTS π¦
cβ the UBIFS file-system description object. your whole file-system, wrapped up in one struct, and yes she's the main character here π«Ά
β¨ DESCRIPTION β¨
so picture this: an operation wants to be budgeted but it can't be, because supposedly there's no free space left. exceptβ¦ bestie, in most cases there is some free space. the budgeting was just being dramatic. π and here's why:
- budgeting is pessimistic, so it always budgets more than it's actually needed. so shrinking the liability is one way to make free space β the cached data will take less space then it was budgeted for. she over-allocated, we take some back, slay π
- GC may turn some dark space into free space β because budgeting treats dark space as not available. not us turning the dark space into free space π₯
- commit may free some LEB, i.e., turn freeable LEBs into free LEBs. iconic behaviour honestly π
so this function tries to do all of the above. literally all three. she's doing the most and we love her for it.
now the receipts on what she returns:
-EAGAINβ some free space was presumably made, and the caller has to re-try budgeting the operation. go on, try again bestie π-ENOSPCβ she couldn't do more free space. that's it, that's the ceiling. π- other negative error codes β on failures. the usual suspects π
ngl,-EAGAINis the good ending here β she found you space, you just gotta go re-try that budgeting.-ENOSPCis the "ma'am, there is genuinely nothing left" ending. respect that boundary.
π SEE ALSO π
kernel file ./fs/ubifs/budget.c β that's where the whole squad lives π§
shrink_liability(9)run_gc(9)get_liability(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)
β and that's the page, bestie β β brought to you by ./fs/ubifs, dated October 2026, filed under make_free_space(9). go forth and free some space, ily ππ¦
π¦ 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