ubifs_find_free_space(9)
πΎ 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 π )
-ENOSPCif it failed to find a LEB withmin_spacebytes 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:
- Kernel file
./fs/ubifs/find.c struct scan_data(9)valuable(9)scan_for_dirty_cb(9)scan_for_dirty(9)ubifs_find_dirty_leb(9)scan_for_free_cb(9)do_find_free_space(9)scan_for_idx_cb(9)scan_for_leb_for_idx(9)ubifs_find_free_leb_for_idx(9)ubifs_save_dirty_idx_lnums(9)scan_dirty_idx_cb(9)find_dirty_idx_leb(9)get_idx_gc_leb(9)find_dirtiest_idx_leb(9)ubifs_find_dirty_idx_leb(9)
iykyk π§
tiny reminder: this page comes from the source tree at./fs/ubifs, dated October 2026, and the manpage tag isubifs_find_free_space(9). gotta credit the source, always. π«Ά
okay bye bestie, go find that free space β periodt. πππ
π¦ 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