Lines Matching refs:parent

75 slab_get_element(struct slab_parent_pool *parent,  in slab_get_element()  argument
79 ((uint8_t*)&page[1] + (parent->element_size * index)); in slab_get_element()
105 slab_create_parent(struct slab_parent_pool *parent, in slab_create_parent() argument
109 mtx_init(&parent->mutex, mtx_plain); in slab_create_parent()
110 parent->element_size = ALIGN_POT(sizeof(struct slab_element_header) + item_size, in slab_create_parent()
112 parent->num_elements = num_items; in slab_create_parent()
116 slab_destroy_parent(struct slab_parent_pool *parent) in slab_destroy_parent() argument
118 mtx_destroy(&parent->mutex); in slab_destroy_parent()
125 struct slab_parent_pool *parent) in slab_create_child() argument
127 pool->parent = parent; in slab_create_child()
141 if (!pool->parent) in slab_destroy_child()
144 mtx_lock(&pool->parent->mutex); in slab_destroy_child()
149 p_atomic_set(&page->u.num_remaining, pool->parent->num_elements); in slab_destroy_child()
151 for (unsigned i = 0; i < pool->parent->num_elements; ++i) { in slab_destroy_child()
152 struct slab_element_header *elt = slab_get_element(pool->parent, page, i); in slab_destroy_child()
163 mtx_unlock(&pool->parent->mutex); in slab_destroy_child()
172 pool->parent = NULL; in slab_destroy_child()
179 pool->parent->num_elements * pool->parent->element_size); in slab_add_new_page()
184 for (unsigned i = 0; i < pool->parent->num_elements; ++i) { in slab_add_new_page()
185 struct slab_element_header *elt = slab_get_element(pool->parent, page, i); in slab_add_new_page()
214 mtx_lock(&pool->parent->mutex); in slab_alloc()
217 mtx_unlock(&pool->parent->mutex); in slab_alloc()
260 mtx_lock(&pool->parent->mutex); in slab_free()
271 mtx_unlock(&pool->parent->mutex); in slab_free()
273 mtx_unlock(&pool->parent->mutex); in slab_free()
301 slab_destroy_parent(&mempool->parent); in slab_destroy()
315 slab_create_parent(&mempool->parent, item_size, num_items); in slab_create()
316 slab_create_child(&mempool->child, &mempool->parent); in slab_create()