ubifs_recover_size_accum(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ ubifs_recover_size_accum ✨

okay so bestie, welcome to the glow-up of ubifs_recover_size_accum(9) β€” that's the kernel API manual page for this little UBIFS recovery helper πŸ’… literally the whole vibe is "accumulate inode sizes for recovery" and honestly? iconic.


🌸 SYNOPSIS 🌸

int ubifs_recover_size_accum (struct ubifs_info *c , union ubifs_key
*key , int deletion , loff_t new_size );

that's the whole signature, fr fr β€” copy it exactly, no cap 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • c β€” the UBIFS file-system description object πŸ’– like, the whole fs's little profile card
  • key β€” the node key πŸ”‘
  • deletion β€” this node is for a deletion πŸ—‘οΈ (yes queen, it's a deletion)
  • new_size β€” the inode size πŸ“

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this function has two purposes, and they're both lowkey doing the most for the integrity of your file system:

  1. to ensure there are no data nodes that fall outside the inode size 🧐
  2. to ensure there are no data nodes for inodes that do not exist πŸ‘»

to accomplish those purposes, a rb-tree is constructed containing an entry for each inode number in the journal that has not been deleted, and recording the size from the inode node, the maximum size of any data node (also altered by truncations) and a flag indicating a inode number for which no inode node was present in the journal. 🌈 it's giving red-black tree main character energy, honestly

note that there is still the possibility that there are data nodes that have been committed that are beyond the inode size, however the only way to find them would be to scan the entire index. alternatively, some provision could be made to record the size of inodes at the start of commit, which would seem very cumbersome for a scenario that is quite unlikely and the only negative consequence of which is wasted space. 😭 so like… yeah. it's a tradeoff, bestie. wasted space is the worst-case, and that's it.

this functions returns 0 on success and a negative error code on failure. ✨ no cap, that's the whole return contract


πŸ’œ SEE ALSO πŸ’œ

kernel file ./fs/ubifs/recovery.c is the home base, and these are all the siblings you should also go stan:


okay that's the whole page, bestie β€” go forth and recover those sizes πŸ’…βœ¨

cute sign-off time πŸŽ€: this one lives in ./fs/ubifs, dated October 2026, and yes those are literally the manual's own source and date, I'm not making it up 🫢

πŸ“¦ where this page comes from