get_leb_cnt(9)
π get_leb_cnt(9) π
okay so bestie, welcome to the Kernel API Manual page for get_leb_cnt β it's giving βhow many empty LEBs do I need to commit?β energy, and honestly it's kinda iconic for such a tiny function. π«Ά
πΈ NAME πΈ
get_leb_cnt β calculate the number of empty LEBs needed to commit. That's the whole assignment, no cap. β¨
π¦ SYNOPSIS π¦
literally the signature, copy it exactly bestie:
int get_leb_cnt (struct ubifs_info *c , int cnt );
π ARGUMENTS π
cβ UBIFS file-system description object. It's the file-system's main-character data structure. πcntβ number of znodes to commit. Slay, that's the count you're trying to commit. π
β¨ DESCRIPTION β¨
So get_leb_cnt returns the number of empty LEBs needed to commit cnt znodes to the current index head. That's the core tea. π«
Lowkey important: the number is not exact and may be more than needed. So don't treat it like a perfect little precise value β it's giving βclose enough for commit logisticsβ, periodt. π
π SEE ALSO π
- Kernel file
./fs/ubifs/tnc_commit.cβ the source file bestie, iykyk. π§ make_idx_node(9)fill_gap(9)find_old_idx(9)is_idx_node_in_use(9)layout_leb_in_gaps(9)layout_in_gaps(9)layout_in_empty_space(9)layout_commit(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)
okay bye bestie, this page came from the ./fs/ubifs source/version and it's dated October 2026 β catch you in the kernel source, 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