layout_commit(9)
β¨ layout_commit(9) β¨
okay so bestie, buckle up β this is layout_commit, from the Kernel API Manual, and she's literally the one who figures out where your index nodes go before commit π
π NAME π
layout_commit β determine positions of index nodes to commit.
like, she does the seating chart for the index nodes before the commit party πͺβ¨
π SYNOPSIS π
int layout_commit (struct ubifs_info *c , int no_space , int cnt );
πΈ ARGUMENTS πΈ
cβ the UBIFS file-system description object π¦ (yes, the whole file-system's little description bestie)no_spaceβ this one flags that insufficient empty LEBs were allocated π like the allocation didn't get enough empty LEBscntβ number of znodes to commit, fr fr
π« DESCRIPTION π«
So the job here is: calculate and update the positions of index nodes to commit. That's it, that's the vibe π
But here's the plot twist: if there were an insufficient number of empty LEBs allocated, then the index nodes get placed into the gaps created by obsolete index nodes in non-empty index LEBs π«Ά For this purpose, an obsolete index node is one that was not in the index as at the end of the last commit. No cap β that's the definition, don't come for me.
And to write "in-the-gaps" requires that those index LEBs are updated atomically in-place π₯ that's a whole requirement, not a suggestion, so keep it in mind iykyk
π¦ SEE ALSO π¦
Kernel file ./fs/ubifs/tnc_commit.c β plus the whole friend group:
make_idx_node(9)fill_gap(9)find_old_idx(9)is_idx_node_in_use(9)layout_leb_in_gaps(9)get_leb_cnt(9)layout_in_gaps(9)layout_in_empty_space(9)find_first_dirty(9)find_next_dirty(9)get_znodes_to_commit(9)alloc_idx_lebs(9)free_unused_idx_lebs(9)free_idx_lebs(9)ubifs_tnc_start_commit(9)write_index(9)free_obsolete_znodes(9)return_gap_lebs(9)ubifs_tnc_end_commit(9)
and that's the whole page, bestie π§π shoutout to ./fs/ubifs for the source, and this one's stamped October 2026, page layout_commit(9) β 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