* Returns the value stored at the index. If the index is not present, * NULL is returned. */
| 475 | * NULL is returned. |
| 476 | */ |
| 477 | static __always_inline vm_page_t |
| 478 | _vm_radix_lookup(struct vm_radix *rtree, vm_pindex_t index, |
| 479 | enum vm_radix_access access) |
| 480 | { |
| 481 | struct vm_radix_node *rnode; |
| 482 | vm_page_t m; |
| 483 | int slot; |
| 484 | |
| 485 | rnode = vm_radix_root_load(rtree, access); |
| 486 | while (rnode != NULL) { |
| 487 | if (vm_radix_isleaf(rnode)) { |
| 488 | m = vm_radix_topage(rnode); |
| 489 | if (m->pindex == index) |
| 490 | return (m); |
| 491 | break; |
| 492 | } |
| 493 | if (vm_radix_keybarr(rnode, index)) |
| 494 | break; |
| 495 | slot = vm_radix_slot(index, rnode->rn_clev); |
| 496 | rnode = vm_radix_node_load(&rnode->rn_child[slot], access); |
| 497 | } |
| 498 | return (NULL); |
| 499 | } |
| 500 | |
| 501 | /* |
| 502 | * Returns the value stored at the index assuming there is an external lock. |
no test coverage detected