layout_leb_in_gaps(9)
π layout_leb_in_gaps(9) β the Kernel API Manual, but make it cute
okay so bestie, welcome to layout_leb_in_gaps β yes that's the whole name, and yes it's from the Kernel API Manual (section 9, kernel developer vibes only π«Ά). she's a little UBIFS intern who does exactly one job and does it slayfully.
β¨ NAME β¨
layout_leb_in_gaps β layout index nodes using in-the-gaps method.
literally that's it. that's her whole personality. π
πΈ SYNOPSIS πΈ
int layout_leb_in_gaps (struct ubifs_info *c , int p );
two arguments, one int coming back at you. no cap. β¨
π ARGUMENTS π
cβ the UBIFS file-system description object. she needs her context, okay? don't come at her without it. π¦pβ the return LEB number, and it lives atc->gap_lebs[p]. that's where you'll find it. iykyk. π
π DESCRIPTION π
so what does she actually do. she lays out new index nodes for dirty znodes β using the in-the-gaps method of TNC commit. iconic behavior honestly.
and here's the thing, bestie, listen: this function merely puts the next znode into the next gap. that's it. she makes no attempt to try to maximise the number of znodes that fit. she's not doing the math, she's not optimizing, she's not that girl β she's just dropping the next znode in the next gap and moving on. main character energy but make it minimal effort. π
what she returns: the number of index nodes written into the gaps, or a negative error code on failure. so if you get a negative number back, that's a vibe check failure, go handle it. π
π₯ SEE ALSO π₯
all her friends from the kernel file ./fs/ubifs/tnc_commit.c β go say hi, they're all linked below, every single one, no skipping:
make_idx_node(9)fill_gap(9)find_old_idx(9)is_idx_node_in_use(9)get_leb_cnt(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)
π«Ά reminder bestie: if she hands you back a negative error code, that's not a cute lil quirk, that's a failure. go check it. fr fr.
and that's the whole page, loves. π this one comes to you straight out of ./fs/ubifs, stamped October 2026, and her full glow-up name is layout_leb_in_gaps(9) β mwah, slay, 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