MCPcopy Create free account
hub / github.com/F-Stack/f-stack / _vm_radix_lookup

Function _vm_radix_lookup

freebsd/vm/vm_radix.c:477–499  ·  view source on GitHub ↗

* Returns the value stored at the index. If the index is not present, * NULL is returned. */

Source from the content-addressed store, hash-verified

475 * NULL is returned.
476 */
477static __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.

Callers 2

vm_radix_lookupFunction · 0.85
vm_radix_lookup_unlockedFunction · 0.85

Calls 6

vm_radix_root_loadFunction · 0.85
vm_radix_isleafFunction · 0.85
vm_radix_topageFunction · 0.85
vm_radix_keybarrFunction · 0.85
vm_radix_slotFunction · 0.85
vm_radix_node_loadFunction · 0.85

Tested by

no test coverage detected