ubifs_reported_space(9)
π ubifs_reported_space(9) β the Kernel API Manual, bestie edition πΈ
okay so this is a page from the Kernel API Manual, section 9, and it's literally all about ubifs_reported_space. yes we're doing kernel filesystem math today, grab a snack π
β¨ NAME β¨
ubifs_reported_space β calculate reported free space. that's it, that's the vibe π
π¦ SYNOPSIS π¦
long long ubifs_reported_space (const struct ubifs_info *c , long long
free );
like, yes, the free param wraps onto the next line, it's fine, it's just living its life π
π ARGUMENTS π
cβ the UBIFS file-system description object. the main character, honestly πfreeβ amount of free space π«Ά
π₯ DESCRIPTION π₯
so what does this function even do. okay so basically it calculates the amount of free space that's gonna get reported to user-space. the whole reason it exists is that user-space applications tend to expect a very specific thing: if the file-system (e.g., via the 'statfs' call) reports that it has N bytes available, then they are able to write a file of size N. like, that's the promise they're holding you to π
but here's the thing β UBIFS attaches node headers to each data node and it has to write indexing nodes as well. this introduces additional overhead, so UBIFS has to report slightly less free space to meet the above expectations. no cap, it's just being honest about the tax π
this function assumes free space is made up of uncompressed data nodes and full index nodes (one per data node, tripled because we always allow enough space to write the index thrice). tripled!! three times!! the dedication honestly π§β¨
note, the calculation is pessimistic, which means that most of the time UBIFS reports less space than it actually has. lowkey humble of it π
π SEE ALSO π
- Kernel file
./fs/ubifs/budget.c shrink_liability(9)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_get_free_space_nolock(9)ubifs_get_free_space(9)
the whole ./fs/ubifs squad, fr fr π«Άβ¨
okay that's the page!! this one's from ./fs/ubifs and it's dated October 2026, and it's ubifs_reported_space(9) β go forth and budget responsibly bestie, mwah ππβ
π¦ 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