is_idx_node_in_tnc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… is_idx_node_in_tnc πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” this lil page is all about is_idx_node_in_tnc, and honestly it's giving "tiny function, big responsibilities". let's get into it 🫢


✨ SYNOPSIS ✨

int is_idx_node_in_tnc (struct ubifs_info *c , union ubifs_key *key ,
int level , int lnum , int offs );

literally that's the whole vibe. five arguments, one int back. no cap. πŸ’€


🌸 ARGUMENTS 🌸

  • c β€” the UBIFS file-system description object. your main character struct, the one that knows everything πŸ’–
  • key β€” the key of the index node. yeah, that key πŸ‘€
  • level β€” the index node level. where it sits in the hierarchy, iykyk πŸ¦‹
  • lnum β€” the LEB number of the index node. that's the physical address vibes πŸŽ€
  • offs β€” the offset of the index node. the little pinpoint inside the LEB ✨

πŸ”₯ DESCRIPTION πŸ”₯

so here's the tea β˜• β€” this function returns a whole little spectrum of answers, and you gotta know which one you got:

  • returns 0 if the index node is not referred to in the TNC πŸ™ˆ
  • returns 1 if the index node is referred to in the TNC and the corresponding znode is dirty πŸ’…
  • returns 2 if an index node is referred to in the TNC and the corresponding znode is clean ✨
  • returns a negative error code in case of failure 😭
⚠️ bestie, listen β€” the key argument has to be the key of the first child. like, that's not optional, that's the whole deal. no substitutions πŸ’€

also note (and this is such a cute little implementation detail): this function relies on the fact that 0:0 is never a valid LEB number and offset for a main-area node. iconic honestly. the code just trusts that and slays 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./fs/ubifs/tnc.c, and then this absolute wall of friends β€” fr fr, this function knows everybody:

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), resolve_collision(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_leaf_node_in_tnc(9), ubifs_tnc_has_node(9), ubifs_dirty_idx_node(9), dbg_check_inode_size(9)

like… the group chat is huge and every single one of them is in it 🧚


mwah πŸ’‹ this page lives under ./fs/ubifs and it's dated October 2026 β€” that's the source, the version and the date all in one cute lil sign-off. go read your kernel docs bestie, ily, bye πŸ’œπŸŽ€

πŸ“¦ where this page comes from