Changeset c47912f in mainline
- Timestamp:
- 2006-04-04T09:04:15Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 448743f
- Parents:
- 2a1fa51
- Location:
- generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/include/adt/btree.h
r2a1fa51 rc47912f 84 84 extern void *btree_search(btree_t *t, __native key, btree_node_t **leaf_node); 85 85 86 extern btree_node_t *btree_ node_left_sibling(btree_t *t, btree_node_t *node);87 extern btree_node_t *btree_ node_right_sibling(btree_t *t, btree_node_t *node);86 extern btree_node_t *btree_leaf_node_left_neighbour(btree_t *t, btree_node_t *node); 87 extern btree_node_t *btree_leaf_node_right_neighbour(btree_t *t, btree_node_t *node); 88 88 89 89 extern void btree_print(btree_t *t); -
generic/src/adt/btree.c
r2a1fa51 rc47912f 341 341 } 342 342 343 /** Return pointer to B-tree node's left sibling.343 /** Return pointer to B-tree leaf node's left neighbour. 344 344 * 345 345 * @param t B-tree. 346 * @param node Node whose left siblingwill be returned.347 * 348 * @return Left sibling of the node or NULL if the node does not have the left sibling.349 */ 350 btree_node_t *btree_ node_left_sibling(btree_t *t, btree_node_t *node)346 * @param node Node whose left neighbour will be returned. 347 * 348 * @return Left neighbour of the node or NULL if the node does not have the left neighbour. 349 */ 350 btree_node_t *btree_leaf_node_left_neighbour(btree_t *t, btree_node_t *node) 351 351 { 352 352 ASSERT(LEAF_NODE(node)); … … 357 357 } 358 358 359 /** Return pointer to B-tree node's right sibling.359 /** Return pointer to B-tree leaf node's right neighbour. 360 360 * 361 361 * @param t B-tree. 362 * @param node Node whose right siblingwill be returned.363 * 364 * @return Right sibling of the node or NULL if the node does not have the right sibling.365 */ 366 btree_node_t *btree_ node_right_sibling(btree_t *t, btree_node_t *node)362 * @param node Node whose right neighbour will be returned. 363 * 364 * @return Right neighbour of the node or NULL if the node does not have the right neighbour. 365 */ 366 btree_node_t *btree_leaf_node_right_neighbour(btree_t *t, btree_node_t *node) 367 367 { 368 368 ASSERT(LEAF_NODE(node)); -
generic/src/mm/as.c
r2a1fa51 rc47912f 526 526 527 527 /* 528 * Search the leaf node and the righmost record of its left sibling528 * Search the leaf node and the righmost record of its left neighbour 529 529 * to find out whether this is a miss or va belongs to an address 530 530 * space area found there. … … 542 542 543 543 /* 544 * Second, locate the left siblingand test its last record.544 * Second, locate the left neighbour and test its last record. 545 545 * Because of its position in the B+tree, it must have base < va. 546 546 */ 547 if ((lnode = btree_ node_left_sibling(&as->as_area_btree, leaf))) {547 if ((lnode = btree_leaf_node_left_neighbour(&as->as_area_btree, leaf))) { 548 548 a = (as_area_t *) lnode->value[lnode->keys - 1]; 549 549 spinlock_lock(&a->lock); … … 584 584 * the number of address space areas belonging to as. 585 585 * The check for conflicts is then attempted on the rightmost 586 * record in the left sibling, the leftmost record in the right587 * siblingand all records in the leaf node itself.586 * record in the left neighbour, the leftmost record in the right 587 * neighbour and all records in the leaf node itself. 588 588 */ 589 589 … … 594 594 595 595 /* First, check the two border cases. */ 596 if ((node = btree_ node_left_sibling(&as->as_area_btree, leaf))) {596 if ((node = btree_leaf_node_left_neighbour(&as->as_area_btree, leaf))) { 597 597 a = (as_area_t *) node->value[node->keys - 1]; 598 598 spinlock_lock(&a->lock); … … 603 603 spinlock_unlock(&a->lock); 604 604 } 605 if ((node = btree_ node_right_sibling(&as->as_area_btree, leaf))) {605 if ((node = btree_leaf_node_right_neighbour(&as->as_area_btree, leaf))) { 606 606 a = (as_area_t *) node->value[0]; 607 607 spinlock_lock(&a->lock);
Note:
See TracChangeset
for help on using the changeset viewer.