resolve_collision(9)
π 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β the collision is resolved! slay. she setsznandnfor you π«Ά0βnmwas not found. and get this:znandnget set to the previous entry, i.e. to the entry after whichnmcould follow if it were in TNC. so heads up β this meansnmay be set to-1if the leftmost key inznis the previous one. lowkey unhinged but it's what she does π- negative error code β returned on failures. sad girl hours π
no cap, that-1case is real and you should not be surprised by it. the leftmost key inznbeing the previous one will do that to an.
π¦ SEE ALSO π¦
she runs with a whole friend group, all from the kernel file ./fs/ubifs/tnc.c. like, literally all of these:
insert_old_idx(9)insert_old_idx_znode(9)ins_clr_old_idx_znode(9)destroy_old_idx(9)copy_znode(9)add_idx_dirt(9)replace_znode(9)dirty_cow_znode(9)lnc_add(9)lnc_free(9)tnc_read_hashed_node(9)try_read_node(9)fallible_read_node(9)matches_name(9)get_znode(9)tnc_next(9)tnc_prev(9)fallible_matches_name(9)fallible_resolve_collision(9)matches_position(9)resolve_collision_directly(9)dirty_cow_bottom_up(9)ubifs_lookup_level0(9)lookup_level0_dirty(9)maybe_leb_gced(9)ubifs_tnc_locate(9)ubifs_tnc_get_bu_keys(9)read_wbuf(9)validate_data_node(9)ubifs_tnc_bulk_read(9)do_lookup_nm(9)ubifs_tnc_lookup_nm(9)ubifs_tnc_lookup_dh(9)correct_parent_keys(9)insert_zbranch(9)tnc_insert(9)ubifs_tnc_add(9)ubifs_tnc_replace(9)ubifs_tnc_add_nm(9)tnc_delete(9)ubifs_tnc_remove(9)ubifs_tnc_remove_nm(9)ubifs_tnc_remove_dh(9)key_in_range(9)ubifs_tnc_remove_range(9)ubifs_tnc_remove_ino(9)ubifs_tnc_next_ent(9)tnc_destroy_cnext(9)ubifs_tnc_close(9)left_znode(9)right_znode(9)lookup_znode(9)is_idx_node_in_tnc(9)is_leaf_node_in_tnc(9)ubifs_tnc_has_node(9)ubifs_dirty_idx_node(9)dbg_check_inode_size(9)
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
- 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