Lines Matching refs:nslots
21 * \param nslots Number of slots to allocate
24 errval_t range_slot_alloc(struct range_slot_allocator *alloc, cslot_t nslots,
41 if (walk->space >= nslots && walk->slot + nslots <= L2_CNODE_SLOTS) {
66 walk->slot += nslots;
67 walk->space -= nslots;
87 * \param nslots Number of slots to insert
91 static errval_t insert_after(struct range_slot_allocator *alloc, size_t nslots,
97 walk->space += nslots;
107 walk->next->space = nslots;
116 * \param nslots Number of slots to insert
121 static errval_t insert_before(struct range_slot_allocator *alloc, size_t nslots,
129 ((slot + nslots) == walk->slot)) { /* Join with prev and walk */
130 prev->space = prev->space + nslots + walk->space;
136 if ((slot + nslots) == walk->slot) { /* Join with walk */
138 walk->space += nslots;
144 prev->space += nslots;
154 new->space = nslots;
171 * \param nslots Number of slots to free
174 cslot_t nslots)
199 err = insert_after(alloc, nslots, cap.slot, walk);
204 err = insert_before(alloc, nslots, cap.slot, prev, walk);
219 alloc->meta->space = nslots;
229 * \param nslots Desired number of slots the cnode should have
233 cslot_t nslots, cslot_t *retslots)
237 if (nslots != L2_CNODE_SLOTS) {
238 debug_printf("WARNING: %s called with nslots=%"PRIuCSLOT"\n",
239 __FUNCTION__, nslots);
240 nslots = L2_CNODE_SLOTS;
254 void *buf = malloc(sizeof(struct cnode_meta) * nslots / 2);
260 slab_grow(&ret->slab, buf, sizeof(struct cnode_meta) * nslots / 2);
269 ret->meta->space = nslots;