keys_eq(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ keys_eq(9) ✨

okay so real quick β€” this is a page from the Kernel API Manual, and honestly? it's a little baby function but it's a crucial little baby function. it lives in the UBIFS world and it's coming to you straight from ./fs/ubifs. let's get into it πŸ’…


🌸 NAME 🌸

keys_eq β€” determine if keys are equivalent.

like... are these two keys the same key? that's it. that's the whole vibe check. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

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

πŸ’– ARGUMENTS πŸ’–

  • c β€” the UBIFS file-system description object 🫢 (yes bestie, the whole filesystem gets to come along)
  • key1 β€” the first key to compare 🌸
  • key2 β€” the second key to compare 🌸

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea: this function compares 2 keys. that's the whole job. and then it returns:

  • 1 if key1 is equal to key2
  • 0 if not

no cap. it's giving "tiny function, huge responsibility" energy and honestly? iconic. it doesn't tell you how they're equal, it doesn't rank them, it doesn't do the keys_cmp thing β€” it literally just hits you with the yes/no binary. main character energy fr fr πŸ’€βœ¨


πŸ‘‘ SEE ALSO πŸ‘‘

if you're gonna hang out in ./fs/ubifs/key.h (the Kernel file 🧚), there's like a whole friend group of key functions you should meet:

key_mask_hash(9), key_r5_hash(9), key_test_hash(9), ino_key_init(9), ino_key_init_flash(9), lowest_ino_key(9), highest_ino_key(9), dent_key_init(9), dent_key_init_hash(9), dent_key_init_flash(9), lowest_dent_key(9), xent_key_init(9), xent_key_init_flash(9), lowest_xent_key(9), data_key_init(9), highest_data_key(9), trun_key_init(9), invalid_key_init(9), key_type(9), key_type_flash(9), key_inum(9), key_inum_flash(9), key_hash(9), key_hash_flash(9), key_block(9), key_block_flash(9), key_read(9), key_write(9), key_write_idx(9), key_copy(9), keys_cmp(9), is_hash_key(9), key_max_inode_size(9)

that's the whole squad. go say hi πŸ¦‹πŸ’œ


lowkey the most important thing on this whole page: 1 = equal, 0 = not equal. don't flip it. i'm begging πŸ™ˆ

and that's the page bestie!! brought to you by ./fs/ubifs, dated October 2026, and yes it's still keys_eq(9) at the bottom because we keep the branding consistent πŸ’…βœ¨ slay.

πŸ“¦ where this page comes from