grab_empty_leb(9)
π grab_empty_leb(9) β a Kernel API Manual moment π
okay so bestie, welcome to the grab_empty_leb(9) page, straight out of the Kernel API Manual. pull up a chair, this one's short but it matters. β¨
πΈ NAME πΈ
grab_empty_leb β grab an empty LEB to use as GC LEB and run commit. literally that's the whole job, and she does it. π
β¨ SYNOPSIS β¨
int grab_empty_leb (struct ubifs_info *c );
that's the whole signature, no cap. one parameter, one int coming back at you. π«Ά
π§ ARGUMENTS π§
cβ the UBIFS file-system description object. yes she's the main character of this entire function, everything happens through her. π
π¦ DESCRIPTION π¦
okay so here's the tea π₯: this is a helper function for ubifs_rcvry_gc_commit. what she does is grab an empty LEB to be used as the GC LEB (that's c->gc_lnum for the note-takers π), and then she runs the commit. periodt.
Returns zero in case of success and a negative error code in case of failure. so like β 0? slay, we're winning π. negative? π something went sideways, check that error code bestie.
ngl this is one of those small functions that's lowkey iconic because the recovery path literally cannot function without her. no pressure though. π
π SEE ALSO π
the whole recovery.c friend group showed up, fr fr β go say hi to all of them:
is_empty(9)first_non_ff(9)get_master_node(9)write_rcvrd_mst_node(9)ubifs_recover_master_node(9)ubifs_write_rcvrd_mst_node(9)is_last_write(9)clean_buf(9)no_more_nodes(9)fix_unclean_leb(9)drop_last_group(9)drop_last_node(9)ubifs_recover_leb(9)get_cs_sqnum(9)ubifs_recover_log_leb(9)recover_head(9)ubifs_recover_inl_heads(9)clean_an_unclean_leb(9)ubifs_clean_lebs(9)ubifs_rcvry_gc_commit(9)struct size_entry(9)add_ino(9)find_ino(9)remove_ino(9)ubifs_destroy_size_tree(9)ubifs_recover_size_accum(9)fix_size_in_place(9)inode_fix_size(9)ubifs_recover_size(9)
and the source of all this chaos lives in the kernel file ./fs/ubifs/recovery.c β iykyk π§
that's the whole page bestie, you ate it up π
mwah π β this lil number came from the ./fs/ubifs corner of the kernel, dated October 2026, and it's the grab_empty_leb(9) page signing off. go forth and recover some LEBs, queen πβ¨
π¦ 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