make_free_space(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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, -EAGAIN is the good ending here β€” she found you space, you just gotta go re-try that budgeting. -ENOSPC is 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 🧚


⭐ 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