keys_cmp(9)
π
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 inkey1β 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:
-1ifkey1is less thankey2π0if the keys are equivalent π€ (they're the same, no cap)1ifkey1is greater thankey2π
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 π
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_eq(9)is_hash_key(9)key_max_inode_size(9)
no literally all 33 of them, I counted, and they're all part of the squad π«Ά go read them, iykyk π
ngl bestie,keys_cmpis the lowkey hero of the whole key family β every one of those*_key_initgirlies 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
- 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