ubifs_find_free_space(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’Ύ ubifs_find_free_space(9) β€” the kernel API manual, but make it make sense ✨

okay bestie, so this one is from the ubifs kernel API manual, and it's literally called ubifs_find_free_space β€” like, the whole personality is "go find me some free space" and honestly? relatable. πŸŽ€


🌸 NAME 🌸

ubifs_find_free_space β€” bestie's whole job is finding a data LEB that's got free space. that's it. that's the function. πŸ¦‹


✨ SYNOPSIS ✨

int ubifs_find_free_space (struct ubifs_info *c , int min_space , int
       *offs , int squeeze );

that's the exact signature, copied character-for-character, no cap. πŸ’…


🫢 ARGUMENTS 🫢

  • c β€” the UBIFS file-system description object. this is the main character, everything happens through it.
  • min_space β€” the minimum amount of free space that's required. like, the bare minimum sis, nothing less.
  • offs β€” on exit this contains the offset of where the free space starts. it's an output, so it gets filled in for you. 🎁
  • squeeze β€” whether to try to find space in a non-empty LEB first. a little "look harder before you give up" vibe.

πŸ’– DESCRIPTION πŸ’–

so what it does: this function goes looking for an LEB that has at least min_space bytes of free space. simple. iconic. lowkey essential.

it tries to find an empty LEB if possible β€” that's the dream scenario, an empty LEB is giving fresh-start energy. but if there are no empty LEBs available, this function searches for a non-empty data LEB instead. resourceful queen. πŸ”₯

and the LEB it returns gets marked as "taken" β€” so it's claimed, spoken for, off the market. πŸ™ˆ

what it returns:

  • the found LEB number if it slays (success πŸ’…)
  • -ENOSPC if it failed to find a LEB with min_space bytes of free space
  • other negative error codes if something else went wrong

so like, check your return value bestie, it's telling you things. 😭


πŸ‘‘ SEE ALSO πŸ‘‘

this is the whole friend group, and we're tagging everyone because nobody gets left out:

iykyk 🧚


tiny reminder: this page comes from the source tree at ./fs/ubifs, dated October 2026, and the manpage tag is ubifs_find_free_space(9). gotta credit the source, always. 🫢

okay bye bestie, go find that free space β€” periodt. πŸ’œπŸŽ€πŸŒˆ

πŸ“¦ where this page comes from