ubifs_gc_start_commit(9)
β¨ ubifs_gc_start_commit(9) β¨
okay so this is a page from the Kernel API Manual, and the star of the show is ubifs_gc_start_commit β say that three times fast, i dare you π
π NAME π
ubifs_gc_start_commit β garbage collection at start of commit. yes bestie, gc but for your file system, and it happens right at the start of commit. iconic behaviour honestly.
π¦ SYNOPSIS π¦
int ubifs_gc_start_commit (struct ubifs_info *c );
πΈ ARGUMENTS πΈ
cβ the UBIFS file-system description object. that's it, that's the whole argument list. one (1) bestie. she's low maintenance π
β DESCRIPTION β
okay so here's the tea π₯ if a LEB has only dirty and free space, then we may safely unmap it and make it free. slay. no cap.
but β and this is the important part, don't @ me β we cannot do this with indexing LEBs, because dirty space may correspond to index nodes that are required for recovery π so in that case, the LEB cannot be unmapped until after the next commit. periodt. that's just how it is.
This function returns 0 upon success and a negative error code upon failure. simple as that π«Ά
ngl, that "cannot do this with indexing LEBs" bit is the whole mood of the function β do not skip it, do not vibe past it, it actually matters.
π SEE ALSO π
Kernel file ./fs/ubifs/gc.c, plus the whole friend group π§:
switch_gc_head(9)data_nodes_cmp(9)sort_nodes(9)move_node(9)move_nodes(9)gc_sync_wbufs(9)ubifs_garbage_collect_leb(9)ubifs_garbage_collect(9)ubifs_gc_end_commit(9)ubifs_destroy_idx_gc(9)ubifs_get_idx_gc_leb(9)
π and that's the whole page, bestie! brought to you by ./fs/ubifs, dated October 2026. go forth and collect your garbage (respectfully) πβ¨
π¦ 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