ubifs_dirty_idx_node(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ubifs_dirty_idx_node β€” dirty an index node, bestie ✨

Okay so like, this is ubifs_dirty_idx_node(9) from the Kernel API Manual, and honestly? It's giving "I make index nodes messy on purpose so they can get cleaned up later" energy. Let me break it down for you 🫢


✨ SYNOPSIS ✨

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

πŸŽ€ ARGUMENTS πŸŽ€

  • c β€” the UBIFS file-system description object, aka the main character of this whole situation πŸ’–
  • key β€” the index node key, iconic as always πŸ”‘
  • level β€” the index node level, no cap πŸ“Š
  • lnum β€” the index node LEB number, literally where it lives 🏠
  • offs β€” the index node offset, the vibe check of its position πŸ“

🌸 DESCRIPTION 🌸

So here's the tea: this function loads and dirties an index node so it can be garbage collected. Slay. πŸ’…

The key argument has to be the key of the first child. Periodt. And this function relies on the fact that 0:0 is never a valid LEB number and offset for a main-area node. That's just how it is, iykyk.

It returns 0 on success and a negative error code on failure. Lowkey important to check that. 😭

Heads up bestie: if you pass something wrong, you're getting a negative error code back. No cap, check your return values.

πŸ¦‹ SEE ALSO πŸ¦‹

The kernel file is ./fs/ubifs/tnc.c and honestly the whole friend group is here:

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_idx_node_in_tnc(9), is_leaf_node_in_tnc(9), ubifs_tnc_has_node(9), dbg_check_inode_size(9)

Whew, that's a lot of links. Go follow them, bestie. πŸŒˆπŸ‘‘


Big shoutout to the source: ./fs/ubifs, dated October 2026 β€” this gem is from the Kernel API Manual and it ate, no crumbs left. πŸ’œ

πŸ“¦ where this page comes from