Basic Solution File System - BSFS
Loading...
Searching...
No Matches
btree_node_t Struct Reference

Represents a single node in the B-tree stored on disk. More...

#include <btree_bsfs.h>

Public Attributes

uint8_t is_leaf
uint32_t num_entries
void * entries
uint32_t * children

Detailed Description

Represents a single node in the B-tree stored on disk.

This structure holds metadata and content for a B-tree node. It supports both leaf and internal nodes, with a flexible entry format configured via the B-tree handle (btree_handle_t).

  • If is_leaf is 1, the node does not have child pointers.
  • If is_leaf is 0, the children array contains block numbers pointing to child nodes.

The number of entries and children is determined by the minimum degree t:

  • Maximum entries: 2t - 1
  • Maximum children: 2t

Member Data Documentation

◆ children

uint32_t* btree_node_t::children

Pointer to the array of child block numbers (only used if the node is internal). The array can hold up to 2t block addresses.

◆ entries

void* btree_node_t::entries

Pointer to the array of entries (opaque key/data pairs). The format and size of each entry are defined in the B-tree handle.

◆ is_leaf

uint8_t btree_node_t::is_leaf

Flag indicating whether the node is a leaf (1) or internal node (0).

◆ num_entries

uint32_t btree_node_t::num_entries

Number of valid entries currently stored in the node.


The documentation for this struct was generated from the following file: