tnc_insert(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… tnc_insert(9) β€” insert a node into TNC ✨

okay so before we get into it β€” this is a tnc_insert(9) situation, page 9 of the Kernel API Manual, and bestie it's giving "small function, big feelings" because it does one thing and then stress-splits when there's no room. iconic behavior honestly. πŸŽ€


🌸 NAME 🌸

tnc_insert β€” insert a node into TNC. that's it. that's the whole name. short king. πŸ‘‘


✨ SYNOPSIS ✨

int tnc_insert (struct ubifs_info *c , struct ubifs_znode *znode ,
struct ubifs_zbranch *zbr , int n );

note the spacing around those commas, it's literally canon, don't come for me. 🫢


πŸ¦‹ ARGUMENTS πŸ¦‹

  • c β€” the UBIFS file-system description object. yes the whole file system. yes it's a lot of responsibility. it's fine. πŸ’…
  • znode β€” the znode you're inserting into. your main character znode. 🌟
  • zbr β€” the branch to insert. the little guy going in. πŸ“
  • n β€” slot number, like which seat the new zbranch gets at the table. no cap. πŸͺ‘

πŸ’– DESCRIPTION πŸ’–

so the way that this works is: this function inserts a new node described by zbr into znode znode. like dropping a new branch into a znode, lowkey surgical, highkey adorable.

but here's the tea β˜• β€” if znode does not have a free slot for the new zbranch, it gets split. and not just that β€” the parent znodes are split as well if needed, so the whole family tree can catch these hands. it's giving "we need to talk about the seating chart" energy. 😭πŸ”₯

return value? she's simple:

  • returns zero in case of success βœ…
  • returns a negative error code in case of failure πŸ’€

literally that's it. zero or sad. iykyk.


πŸ‘‘ SEE ALSO πŸ‘‘

okay these cross-references are a lot but we don't skip, we don't cut, we list every single one because we're thorough besties. Kernel file ./fs/ubifs/tnc.c plus:

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), 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).

like, the whole friend group. πŸ«‚ a whole group chat worth of functions. go say hi to all of them, they're all in ./fs/ubifs.


mwah πŸ’‹ that's the page. brought to you by ./fs/ubifs, dated October 2026, and this little tnc_insert(9) footer moment is your sign-off β€” stay splittable, stay slay, and always check for free slots before you commit. πŸ§šβ€β™€οΈπŸŒˆβœ¨

πŸ“¦ where this page comes from