keys_cmp(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… keys_cmp ✨ (that's the manual name btw, keys_cmp from the Kernel API Manual, section 9)

okay so bestie, gather round, because we're about to talk about the most "small but mighty" little function in all of UBIFS πŸŽ€

✨ NAME ✨

keys_cmp β€” literally just compares keys. that's it. that's the whole gig πŸ’…


🌸 SYNOPSIS 🌸

int keys_cmp (const struct ubifs_info *c , const union ubifs_key *key1 ,
       const union ubifs_key *key2 );

look at her. three args, returns an int, zero notes. icon behavior πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • c β€” the UBIFS file-system description object πŸ—‚οΈ like, the whole context bestie, you gotta know what filesystem we're even in
  • key1 β€” the first key to compare πŸ₯‡
  • key2 β€” the second key to compare πŸ₯ˆ (yes it's a competition now)

πŸ’– DESCRIPTION πŸ’–

so the way this works is genuinely so simple it's giving main character energy ✨ β€” it compares the 2 keys and hands you back one of three possible answers:

  • -1 if key1 is less than key2 πŸ“‰
  • 0 if the keys are equivalent 🀝 (they're the same, no cap)
  • 1 if key1 is greater than key2 πŸ“ˆ

and that's the whole vibe check. three possible outputs, no drama, no edge cases listed, fr fr 😌


🌈 SEE ALSO 🌈

okay this is the part where I hold your hand and walk you through the entire UBIFS key extended family, because there are so many of them and they all live in the same house: the Kernel file ./fs/ubifs/key.h πŸ“‚

no literally all 33 of them, I counted, and they're all part of the squad 🫢 go read them, iykyk πŸ’œ


ngl bestie, keys_cmp is the lowkey hero of the whole key family β€” every one of those *_key_init girlies above needs somebody to actually compare the results, and that's her πŸ’€πŸ”₯

and that's a wrap! πŸŽ€ this lil page comes to you straight out of ./fs/ubifs, circa October 2026, manual section keys_cmp(9) ✨ slay, bye! πŸ’…πŸ’–

πŸ“¦ where this page comes from