data_nodes_cmp(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 a void *, 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:


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