grab_empty_leb(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:

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