* Allocate a radix node. */
| 122 | * Allocate a radix node. |
| 123 | */ |
| 124 | static struct vm_radix_node * |
| 125 | vm_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. |
no test coverage detected