data_nodes_cmp(9)
π data_nodes_cmp(9) β like, the Kernel API Manual page your bestie actually reads β¨
okay so real talk, this is a page straight out of the Kernel API Manual and it's short but it eats. We're comparing data nodes. That's the whole vibe. Let's go π
β¨ NAME β¨
data_nodes_cmp β compare 2 data nodes. that's it, that's the function, and honestly? iconic for being so direct π
πΈ SYNOPSIS πΈ
int data_nodes_cmp (void *priv , const struct list_head *a ,
const struct list_head *b );
look at that signature. look at it. three args, one int coming back at you, no cap π«Ά
π¦ ARGUMENTS π¦
privβ the UBIFS file-system description object. yes bestie it's avoid *, no we're not gonna fight about it, it's just the file-system description riding along πaβ the first data node. the main character of the comparison, lowkey πbβ the second data node. the challenger. the rival. the other one in the ring π₯
π DESCRIPTION π
so what does it do. It compares data nodes a and b. That's the assignment, and it understood it π
Here's the tea: it returns 1 if a has a greater inode or block number, and -1 otherwise. That's it. One or minus one. No zero, no in-between, no "it depends" β fr fr, those are the only two outcomes π
π₯ SEE ALSO π₯
the whole friend group, because nobody in the kernel does anything alone:
- Kernel file
./fs/ubifs/gc.cβ the source file, the origin story π« switch_gc_head(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_start_commit(9)ubifs_gc_end_commit(9)ubifs_destroy_idx_gc(9)ubifs_get_idx_gc_leb(9)
ngl if you're in ./fs/ubifs reading about garbage collection at 2am, that's main character energy and I respect it π
anyway that's the page! shoutout to ./fs/ubifs and the October 2026 date stamp, this has been your girl signing off β go sort some nodes, bestie, you're gonna slay πβ¨π
π¦ 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