insert_old_idx(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– insert_old_idx(9) πŸ’–

Kernel API Manual bestie edition ✨ this page is all about insert_old_idx(9), no cap.


✨ NAME ✨

insert_old_idx β€” record an index node obsoleted since the last commit start.


🌸 SYNOPSIS 🌸

int insert_old_idx (struct ubifs_info *c , int lnum , int offs );

πŸŽ€ ARGUMENTS πŸŽ€

  • c β€” UBIFS file-system description object. That's her whole identity, okay?
  • lnum β€” LEB number of obsoleted index node.
  • offs β€” offset of obsoleted index node.

πŸ¦‹ DESCRIPTION πŸ¦‹

Returns 0 on success, and a negative error code on failure. Zero is the slay outcome; negative is the sad trombone 😭.

For recovery, there must always be a complete intact version of the index on flash at all times. That is called the "old index". It is the index as at the time of the last successful commit. Many of the index nodes in the old index may be dirty, but they must not be erased until the next successful commit (at which point that index becomes the old index). Periodt β€” do not erase them early, bestie πŸ’….

That means that the garbage collection and the in-the-gaps method of committing must be able to determine if an index node is in the old index. Most of the old index nodes can be found by looking up the TNC using the β€” and the source wording is genuinely glitching here, so I'm giving you the raw fragment β€” been deleted from the current index or may have been changed so much that they cannot be easily found. In those cases, an entry is added to an RB-tree. That is what this function does. The RB-tree is ordered by LEB number and offset because they uniquely identify the old index node.

🚨 Little source-text glitch alert: that been deleted… fragment is exactly the incomplete wording from the page. I am not inventing missing words, bestie. We keep the facts, we keep the glitch πŸ’€.

🌈 SEE ALSO 🌈

Kernel file ./fs/ubifs/tnc.c is the home base. The rest of the SEE ALSO crew: 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), ubifs_dirty_idx_node(9), dbg_check_inode_size(9).


That's the whole page, bestie 🫢 source/version: ./fs/ubifs ✨ date: October 2026 πŸ’– page: insert_old_idx(9) from the Kernel API Manual β€” bye! πŸ’…

πŸ“¦ where this page comes from