ubifs_reported_space(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ‘€

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