make_nnode_dirty(9)
π make_nnode_dirty β section 9, kernel API, bestie edition π
okay so you found yourself a page from the Kernel API Manual, section 9, and it's all about make_nnode_dirty. ngl this one's a whole little LPT-era deep cut, but we're gonna get through it together, fr fr β¨
πΈ NAME πΈ
make_nnode_dirty β the function that goes and finds a nnode, and if it actually finds one, makes it dirty. that's it, that's the whole job π
β SYNOPSIS β
int make_nnode_dirty (struct ubifs_info *c , int node_num , int lnum ,
offs );
like, yes, it returns an int, and yes, it takes four things. let's meet them π«Ά
π ARGUMENTS π
cβ the UBIFS file-system description object. your whole context, your main character struct, the vibe container β¨node_numβ the nnode number of the nnode you want to make dirty. this is literally which nnode we're talking about πlnumβ the LEB number where that nnode was written. receipts of where it lives πoffsβ the offset where that nnode was written. so precise, we love an exact location π
π¦ DESCRIPTION π¦
so, the lore: this function is used by LPT garbage collection. and LPT garbage collection is used only for the "big" LPT model, which is when c->big_lpt == 1 β no cap, that's the condition, that's the gate π
the garbage collection itself is honestly so simple it's iconic: it just involves marking all the nodes in the LEB that's being garbage-collected as dirty. that's the move. mark them all π«Ά
then the dirty nodes get written at the next commit, and after that, the LEB is free to be reused. slay, recycling π
and the return situation? this function returns 0 on success and a negative error code on failure. short and sweet, periodt β
π₯ SEE ALSO π₯
okay this list is long and honestly kind of iconic, so buckle up bestie, we're naming everyone in the group chat π
first up, the kernel file it all lives in: ./fs/ubifs/lpt_commit.c β and then:
first_dirty_cnode(9), next_dirty_cnode(9), get_cnodes_to_commit(9), upd_ltab(9), alloc_lpt_leb(9), layout_cnodes(9), realloc_lpt_leb(9), write_cnodes(9), next_pnode_to_dirty(9), add_pnode_dirt(9), do_make_pnode_dirty(9), make_tree_dirty(9), need_write_all(9), lpt_tgc_start(9), lpt_tgc_end(9), populate_lsave(9), nnode_lookup(9), make_pnode_dirty(9), make_ltab_dirty(9), make_lsave_dirty(9), make_node_dirty(9), get_lpt_node_len(9), get_pad_len(9), get_lpt_node_type(9), is_a_node(9), lpt_gc_lnum(9), lpt_gc(9), ubifs_lpt_start_commit(9), free_obsolete_cnodes(9), ubifs_lpt_end_commit(9), ubifs_lpt_post_commit(9), first_nnode(9), next_nnode(9), ubifs_lpt_free(9), dbg_is_all_ff(9), dbg_is_nnode_dirty(9), dbg_is_pnode_dirty(9), dbg_is_ltab_dirty(9), dbg_is_lsave_dirty(9), dbg_is_node_dirty(9), dbg_check_ltab_lnum(9), dbg_check_ltab(9), dbg_chk_lpt_free_spc(9), dbg_chk_lpt_sz(9), dump_lpt_leb(9), ubifs_dump_lpt_lebs(9), dbg_populate_lsave(9)
like... every single one of them. no skips, no cuts, we keep the whole roster π iykyk
ok that's the page!! no hidden extras from me, every flag and every name above is exactly what the manual says β go be nosy in ./fs/ubifs/lpt_commit.c if you want more lore π§
and that's a wrap, bestie!! this one came from the ./fs/ubifs corner of the kernel, dated October 2026 β drink some water, go touch a filesystem, and remember: mark it dirty, next commit handles the rest πβ¨π
π¦ 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