B+TREE BASICS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 B+Tree basics 🌸

okay so bestie, welcome to the B+Tree basics(9) page from the Kernel API Manual β€” this is the kernel data-structure tea you need. A B+Tree is a data structure for looking up arbitrary keys into pointers, and rn β€œarbitrary” currently allows unsigned long, u32, u64 and 2 * u64 keys. The data structure is described at https://en.wikipedia.org/wiki/B-tree, and real talk: we currently do not use binary search to find the key on lookups. no cap πŸ’…

Each B+Tree consists of a head, which contains bookkeeping information, plus a variable number of nodes β€” starting with zero, bestie. Each node contains the keys and pointers to sub-nodes, or, for leaf nodes, the keys and values for the tree entries. iconic ✨

Each node in this implementation has the following layout:

[key1, key2, ..., keyN] [val1, val2, ..., valN]

Each key here is an array of unsigned longs, geo->no_longs in total. The number of keys and values (N) is geo->no_pairs. slay πŸ¦‹


πŸ‘€ SEE ALSO πŸ‘€

mwah πŸ’‹ β€” source/version: ./include/linux; date: October 2026; page: B+Tree basics(9) 🫢

πŸ“¦ where this page comes from