resolve_collision(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… resolve_collision(9) β€” like, the collision-resolving girlie of the kernel API manual ✨

okay so bestie, welcome to resolve_collision(9), straight out of the Kernel API Manual. grab a strawberry πŸ“ and let's get into it.


🌸 NAME 🌸

resolve_collision β€” resolve a collision. that's it, that's the vibe. it resolves a collision, no cap.


✨ SYNOPSIS ✨

int resolve_collision (struct ubifs_info *c , const union ubifs_key *key
, struct ubifs_znode **zn , int *n , const struct fscrypt_name *nm );

look at her. five args, one int back. she's serving signature energy πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • c β€” the UBIFS file-system description object. like, the whole filesystem's little personality profile πŸ¦‹
  • key β€” key of a directory or extended attribute entry. it's giving "who are we even looking for" πŸ”
  • zn β€” znode is returned here. yes bestie, it's an out-param, she gets filled in πŸ“₯
  • n β€” zbranch number is passed and returned here. in and out, she's versatile like that 😭
  • nm β€” name of the entry. the actual name-name, the whole point of the search 🏷️

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea. this function gets called for "hashed" keys β€” the ones that got hashed β€” and its whole job is making sure that the key we found actually corresponds to the node we looked up (a directory or extended attribute entry). like, vibe check the match, fr fr. πŸ”₯

here's the receipt on what she returns:

  1. 1 β€” the collision is resolved! slay. she sets zn and n for you 🫢
  2. 0 β€” nm was not found. and get this: zn and n get set to the previous entry, i.e. to the entry after which nm could follow if it were in TNC. so heads up β€” this means n may be set to -1 if the leftmost key in zn is the previous one. lowkey unhinged but it's what she does πŸ’€
  3. negative error code β€” returned on failures. sad girl hours 😭
no cap, that -1 case is real and you should not be surprised by it. the leftmost key in zn being the previous one will do that to a n.

πŸ¦‹ SEE ALSO πŸ¦‹

she runs with a whole friend group, all from the kernel file ./fs/ubifs/tnc.c. like, literally all of these:

go read them. iykyk πŸ“š


and that's the page, bestie 🧚 this one shipped from ./fs/ubifs, dated October 2026, and yes β€” the manual tag resolve_collision(9) belongs to her, periodt. mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from