tdb2: change to using a hash tree.
As the locking issues with enlarging a hash were so nasty, we switch to a tree structure for the entries. It's a hash which expands to point to sub-hashes when it fills. This means we no longer have a 'volatile' header: the top hash cannot move. In fact, we no longer store a copy of the header in the tdb_context; we only need hash_seed. New helper functions for accessing writable areas and committing the results (if they had to be copied). New debug test to make sure we don't hold access while we're doing something which could cause us to unmap/remap. Find becomes more complicated: we need to track where we found (or didn't find) an entry so we can easily add/delete it. Traverse becomes more complicated: we need to track where we were in the hash tree.
Showing
This diff is collapsed.
ccan/tdb2/hash.c
0 → 100644
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment