Lines Matching refs:slab

449     struct _WsbmSlab *slab;  in wsbmAllocSlab()  local
455 slab = calloc(1, sizeof(*slab)); in wsbmAllocSlab()
456 if (!slab) in wsbmAllocSlab()
459 slab->kbo = wsbmAllocKernelBO(header); in wsbmAllocSlab()
460 if (!slab->kbo) { in wsbmAllocSlab()
465 numBuffers = slab->kbo->actualSize / header->bufSize; in wsbmAllocSlab()
467 slab->buffers = calloc(numBuffers, sizeof(*slab->buffers)); in wsbmAllocSlab()
468 if (!slab->buffers) { in wsbmAllocSlab()
473 WSBMINITLISTHEAD(&slab->head); in wsbmAllocSlab()
474 WSBMINITLISTHEAD(&slab->freeBuffers); in wsbmAllocSlab()
475 slab->numBuffers = numBuffers; in wsbmAllocSlab()
476 slab->numFree = 0; in wsbmAllocSlab()
477 slab->header = header; in wsbmAllocSlab()
479 sBuf = slab->buffers; in wsbmAllocSlab()
484 sBuf->parent = slab; in wsbmAllocSlab()
486 sBuf->virtual = (void *)((uint8_t *) slab->kbo->virtual + in wsbmAllocSlab()
491 WSBMLISTADDTAIL(&sBuf->head, &slab->freeBuffers); in wsbmAllocSlab()
492 slab->numFree++; in wsbmAllocSlab()
496 WSBMLISTADDTAIL(&slab->head, &header->slabs); in wsbmAllocSlab()
501 sBuf = slab->buffers; in wsbmAllocSlab()
503 if (sBuf->parent == slab) { in wsbmAllocSlab()
509 free(slab->buffers); in wsbmAllocSlab()
511 wsbmSetKernelBOFree(header->slabPool->cache, slab->kbo); in wsbmAllocSlab()
513 free(slab); in wsbmAllocSlab()
525 struct _WsbmSlab *slab = buf->parent; in wsbmSlabFreeBufferLocked() local
526 struct _WsbmSlabSizeHeader *header = slab->header; in wsbmSlabFreeBufferLocked()
530 WSBMLISTADDTAIL(list, &slab->freeBuffers); in wsbmSlabFreeBufferLocked()
531 slab->numFree++; in wsbmSlabFreeBufferLocked()
533 if (slab->head.next == &slab->head) in wsbmSlabFreeBufferLocked()
534 WSBMLISTADDTAIL(&slab->head, &header->slabs); in wsbmSlabFreeBufferLocked()
536 if (slab->numFree == slab->numBuffers) { in wsbmSlabFreeBufferLocked()
537 list = &slab->head; in wsbmSlabFreeBufferLocked()
543 slab->numFree != slab->numBuffers) { in wsbmSlabFreeBufferLocked()
552 slab = WSBMLISTENTRY(list, struct _WsbmSlab, head); in wsbmSlabFreeBufferLocked()
556 sBuf = slab->buffers; in wsbmSlabFreeBufferLocked()
557 for (i = 0; i < slab->numBuffers; ++i) { in wsbmSlabFreeBufferLocked()
558 if (sBuf->parent == slab) { in wsbmSlabFreeBufferLocked()
564 wsbmSetKernelBOFree(cache, slab->kbo); in wsbmSlabFreeBufferLocked()
565 free(slab->buffers); in wsbmSlabFreeBufferLocked()
566 free(slab); in wsbmSlabFreeBufferLocked()
576 struct _WsbmSlab *slab; in wsbmSlabCheckFreeLocked() local
614 slab = sBuf->parent; in wsbmSlabCheckFreeLocked()
651 struct _WsbmSlab *slab; in wsbmSlabAllocBuffer() local
674 slab = WSBMLISTENTRY(list, struct _WsbmSlab, head); in wsbmSlabAllocBuffer()
675 if (--slab->numFree == 0) in wsbmSlabAllocBuffer()
678 list = slab->freeBuffers.next; in wsbmSlabAllocBuffer()
797 struct _WsbmSlab *slab; in pool_destroy() local
822 slab = sBuf->parent; in pool_destroy()
823 header = slab->header; in pool_destroy()