alloc_idx_lebs(9)
β¨ alloc_idx_lebs β the Kernel API Manual entry that's literally about making room for index nodes β¨
okay so bestie, welcome to alloc_idx_lebs from the Kernel API Manual β yes that's the manual name, and yes it's giving very "deep in the fs/ubifs trenches" energy and we're obsessed π«Ά
π NAME π
alloc_idx_lebs β allocate empty LEBs to be used to commit.
like, it grabs you some nice empty LEBs so the commit can actually happen. that's the whole job. icon behaviour honestly π
β¨ SYNOPSIS β¨
int alloc_idx_lebs (struct ubifs_info *c , int cnt );
one function, two args, returns an int. short and slay π
π¦ ARGUMENTS π¦
cβ the UBIFS file-system description object π this is your whole contexte, your main character struct, the thing that knows everything about the filesystem.cntβ the number of znodes you wanna commit. that's it, that's the count, don't overthink it bestie πΈ
π₯ DESCRIPTION π₯
so here's the vibe check: this function goes and allocates empty LEBs that are gonna be used to commit. π§
if it cannot allocate a sufficient number of empty LEBs, it returns -ENOSPC β no space, bestie, it's giving "the disk said no" π but if everything works out?
0 is returned on success. periodt. β¨
and anything else? a negative error code gets returned. like, that's the whole contract, no cap. β
π SEE ALSO π
Kernel file ./fs/ubifs/tnc_commit.c plus the whole friend group of functions that are lowkey in the same orbit β go say hi to all of them:
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)layout_commit(9)find_first_dirty(9)find_next_dirty(9)get_znodes_to_commit(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)
that's nineteen besties, i counted, and they're all linked for a reason π
sign-off time π«Ά this little page lives out of ./fs/ubifs and it's dated October 2026 β so yeah, future vibes, present-tense slay. ππβ¨
π¦ 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