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

Function vm_radix_node_get

freebsd/vm/vm_radix.c:124–147  ·  view source on GitHub ↗

* Allocate a radix node. */

Source from the content-addressed store, hash-verified

122 * Allocate a radix node.
123 */
124static struct vm_radix_node *
125vm_radix_node_get(vm_pindex_t owner, uint16_t count, uint16_t clevel)
126{
127 struct vm_radix_node *rnode;
128
129 rnode = uma_zalloc_smr(vm_radix_node_zone, M_NOWAIT);
130 if (rnode == NULL)
131 return (NULL);
132
133 /*
134 * We want to clear the last child pointer after the final section
135 * has exited so lookup can not return false negatives. It is done
136 * here because it will be cache-cold in the dtor callback.
137 */
138 if (rnode->rn_last != 0) {
139 vm_radix_node_store(&rnode->rn_child[rnode->rn_last - 1],
140 NULL, UNSERIALIZED);
141 rnode->rn_last = 0;
142 }
143 rnode->rn_owner = owner;
144 rnode->rn_count = count;
145 rnode->rn_clev = clevel;
146 return (rnode);
147}
148
149/*
150 * Free radix node.

Callers 1

vm_radix_insertFunction · 0.85

Calls 2

uma_zalloc_smrFunction · 0.85
vm_radix_node_storeFunction · 0.85

Tested by

no test coverage detected