Hello there!
I hope you can help me with this since I'm going to get crazy...
I'm trying to read and understand the radix tree code (lib/radix.c) but although in theory it's very clear the way it's organised (I read and understood about it in "understanding the linux kernel"), I cannot understand the way it works in practice. Above all I have serious problems to understand the way the indexes are organised..
Do you know where could I find some documentation?
For the moment, I wanted to read the radix_tree_delete and my main problem concerns understanding these macros:
Code:
#define BITS_PER_LONG 64
#define RADIX_TREE_MAX_TAGS 2
#define RADIX_TREE_MAP_SHIFT 3 /* For more stressful testing */
#define RADIX_TREE_MAP_SIZE (1UL << RADIX_TREE_MAP_SHIFT)
#define RADIX_TREE_MAP_MASK (RADIX_TREE_MAP_SIZE-1)
#define RADIX_TREE_TAG_LONGS \
((RADIX_TREE_MAP_SIZE + BITS_PER_LONG - 1) / BITS_PER_LONG)
#define RADIX_TREE_INDEX_BITS (8 /* CHAR_BIT */ * sizeof(unsigned long))
#define RADIX_TREE_MAX_PATH (RADIX_TREE_INDEX_BITS/RADIX_TREE_MAP_SHIFT + 2)
and the idea behind radix_tree_direct_to_ptr() & co..
thanks a lot for any help you'll give me!
Bye!