From e25dc39fd502ae5c6c1c44a798a24dc5c6a1c7b0 Mon Sep 17 00:00:00 2001 From: Masahiko Sawada Date: Mon, 17 Apr 2023 17:26:52 +0900 Subject: [PATCH v32 07/18] radix tree: rename RT_EXTEND and RT_SET_EXTEND to RT_EXTEND_UP/DOWN --- src/include/lib/radixtree.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/include/lib/radixtree.h b/src/include/lib/radixtree.h index e546bd705c..c277d5a484 100644 --- a/src/include/lib/radixtree.h +++ b/src/include/lib/radixtree.h @@ -152,8 +152,8 @@ #define RT_INIT_NODE RT_MAKE_NAME(init_node) #define RT_FREE_NODE RT_MAKE_NAME(free_node) #define RT_FREE_RECURSE RT_MAKE_NAME(free_recurse) -#define RT_EXTEND RT_MAKE_NAME(extend) -#define RT_SET_EXTEND RT_MAKE_NAME(set_extend) +#define RT_EXTEND_UP RT_MAKE_NAME(extend_up) +#define RT_EXTEND_DOWN RT_MAKE_NAME(extend_down) #define RT_SWITCH_NODE_KIND RT_MAKE_NAME(grow_node_kind) #define RT_COPY_NODE RT_MAKE_NAME(copy_node) #define RT_REPLACE_NODE RT_MAKE_NAME(replace_node) @@ -1243,7 +1243,7 @@ RT_REPLACE_NODE(RT_RADIX_TREE *tree, RT_PTR_LOCAL parent, * it can store the key. */ static pg_noinline void -RT_EXTEND(RT_RADIX_TREE *tree, uint64 key) +RT_EXTEND_UP(RT_RADIX_TREE *tree, uint64 key) { int target_shift; RT_PTR_LOCAL root = RT_PTR_GET_LOCAL(tree, tree->ctl->root); @@ -1282,7 +1282,7 @@ RT_EXTEND(RT_RADIX_TREE *tree, uint64 key) * Insert inner and leaf nodes from 'node' to bottom. */ static pg_noinline void -RT_SET_EXTEND(RT_RADIX_TREE *tree, uint64 key, RT_VALUE_TYPE *value_p, RT_PTR_LOCAL parent, +RT_EXTEND_DOWN(RT_RADIX_TREE *tree, uint64 key, RT_VALUE_TYPE *value_p, RT_PTR_LOCAL parent, RT_PTR_ALLOC stored_node, RT_PTR_LOCAL node) { int shift = node->shift; @@ -1613,7 +1613,7 @@ RT_SET(RT_RADIX_TREE *tree, uint64 key, RT_VALUE_TYPE *value_p) /* Extend the tree if necessary */ if (key > tree->ctl->max_val) - RT_EXTEND(tree, key); + RT_EXTEND_UP(tree, key); stored_child = tree->ctl->root; parent = RT_PTR_GET_LOCAL(tree, stored_child); @@ -1631,7 +1631,7 @@ RT_SET(RT_RADIX_TREE *tree, uint64 key, RT_VALUE_TYPE *value_p) if (!RT_NODE_SEARCH_INNER(child, key, &new_child)) { - RT_SET_EXTEND(tree, key, value_p, parent, stored_child, child); + RT_EXTEND_DOWN(tree, key, value_p, parent, stored_child, child); RT_UNLOCK(tree); return false; } @@ -2470,8 +2470,8 @@ RT_DUMP(RT_RADIX_TREE *tree) #undef RT_INIT_NODE #undef RT_FREE_NODE #undef RT_FREE_RECURSE -#undef RT_EXTEND -#undef RT_SET_EXTEND +#undef RT_EXTEND_UP +#undef RT_EXTEND_DOWN #undef RT_SWITCH_NODE_KIND #undef RT_COPY_NODE #undef RT_REPLACE_NODE -- 2.31.1