ubifs_find_dirty_idx_leb(9)
β¨ ubifs_find_dirty_idx_leb β the kernel API manual, but make it make sense β¨
okay so bestie, welcome to the group chat π
this is the page for ubifs_find_dirty_idx_leb(9) from the Kernel API Manual, and honestly? it's giving "one very specific little helper function that does exactly one thing and we respect it for that" π
πΈ NAME πΈ
ubifs_find_dirty_idx_leb β literally just trying to find the dirtiest index LEB as of the last commit π§ no cap, that's the whole job
π¦ SYNOPSIS π¦
int ubifs_find_dirty_idx_leb (struct ubifs_info *c );
one function, one argument, one int coming back at you β¨ iconic, minimal, no notes
π ARGUMENTS π
cβ the UBIFS file-system description object ποΈ like, the whole file system's little info bundle. that's the vibe.
π DESCRIPTION π
so here's the tea βοΈ this function attempts to find an untaken index LEB that has the most free and dirty space β and the key part, bestie, is that it has to be usable without overwriting index nodes that were in the last index committed π«Ά
read that again because it's lowkey the whole point π it's not just "find a dirty one", it's "find a dirty one that's safe", and those are very different energy. untaken β most free and dirty space β doesn't clobber the last-committed index nodes β
that's it. that's the function. slay. π₯
π SEE ALSO π
this next part is a whole friend group, so let's do a roll call π£ all of these are from the Kernel file ./fs/ubifs/find.c:
struct scan_data(9)valuable(9)scan_for_dirty_cb(9)scan_for_dirty(9)ubifs_find_dirty_leb(9)scan_for_free_cb(9)do_find_free_space(9)ubifs_find_free_space(9)scan_for_idx_cb(9)scan_for_leb_for_idx(9)ubifs_find_free_leb_for_idx(9)ubifs_save_dirty_idx_lnums(9)scan_dirty_idx_cb(9)find_dirty_idx_leb(9)get_idx_gc_leb(9)find_dirtiest_idx_leb(9)
look at that squad π every single one accounted for, nobody left on read π
ngl, if you're reading this page you're probably already deep in UBIFS index GC internals β and honestly? main character energy. go off. π
and that's a wrap, bestie π this page lives at ./fs/ubifs in the Kernel API Manual, dated October 2026 β so like, mark your calendar or whatever, because that's the version/date stamp and we're mentioning it in the sign-off like the little footnote it is π«Άβ¨ bye, love you, go read find.c π
π¦ 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