Lines Matching refs:header

135     struct _WsbmSlabSizeHeader *header;  member
311 wsbmAllocKernelBO(struct _WsbmSlabSizeHeader *header) in wsbmAllocKernelBO() argument
313 struct _WsbmSlabPool *slabPool = header->slabPool; in wsbmAllocKernelBO()
316 uint32_t size = header->bufSize * slabPool->desiredNumBuffers; in wsbmAllocKernelBO()
327 if (size < header->bufSize) in wsbmAllocKernelBO()
328 size = header->bufSize; in wsbmAllocKernelBO()
447 wsbmAllocSlab(struct _WsbmSlabSizeHeader *header) in wsbmAllocSlab() argument
459 slab->kbo = wsbmAllocKernelBO(header); in wsbmAllocSlab()
465 numBuffers = slab->kbo->actualSize / header->bufSize; in wsbmAllocSlab()
477 slab->header = header; in wsbmAllocSlab()
481 ret = wsbmBufStorageInit(&sBuf->storage, &header->slabPool->pool); in wsbmAllocSlab()
485 sBuf->start = i * header->bufSize; in wsbmAllocSlab()
496 WSBMLISTADDTAIL(&slab->head, &header->slabs); in wsbmAllocSlab()
511 wsbmSetKernelBOFree(header->slabPool->cache, slab->kbo); in wsbmAllocSlab()
526 struct _WsbmSlabSizeHeader *header = slab->header; in wsbmSlabFreeBufferLocked() local
534 WSBMLISTADDTAIL(&slab->head, &header->slabs); in wsbmSlabFreeBufferLocked()
539 WSBMLISTADDTAIL(list, &header->freeSlabs); in wsbmSlabFreeBufferLocked()
542 if (header->slabs.next == &header->slabs || in wsbmSlabFreeBufferLocked()
546 struct _WsbmSlabCache *cache = header->slabPool->cache; in wsbmSlabFreeBufferLocked()
548 WSBMLISTFOREACHSAFE(list, next, &header->freeSlabs) { in wsbmSlabFreeBufferLocked()
572 wsbmSlabCheckFreeLocked(struct _WsbmSlabSizeHeader *header, int wait) in wsbmSlabCheckFreeLocked() argument
591 first = header->delayedBuffers.next; in wsbmSlabCheckFreeLocked()
595 if (header->numDelayed > 3) { in wsbmSlabCheckFreeLocked()
596 for (i = 0; i < header->numDelayed; i += 3) { in wsbmSlabCheckFreeLocked()
609 if (list == &header->delayedBuffers) in wsbmSlabCheckFreeLocked()
634 header->numDelayed--; in wsbmSlabCheckFreeLocked()
640 header->numDelayed--; in wsbmSlabCheckFreeLocked()
648 wsbmSlabAllocBuffer(struct _WsbmSlabSizeHeader *header) in wsbmSlabAllocBuffer() argument
655 WSBM_MUTEX_LOCK(&header->mutex); in wsbmSlabAllocBuffer()
656 while (header->slabs.next == &header->slabs && count > 0) { in wsbmSlabAllocBuffer()
657 wsbmSlabCheckFreeLocked(header, 0); in wsbmSlabAllocBuffer()
658 if (header->slabs.next != &header->slabs) in wsbmSlabAllocBuffer()
661 WSBM_MUTEX_UNLOCK(&header->mutex); in wsbmSlabAllocBuffer()
664 WSBM_MUTEX_LOCK(&header->mutex); in wsbmSlabAllocBuffer()
665 (void)wsbmAllocSlab(header); in wsbmSlabAllocBuffer()
669 list = header->slabs.next; in wsbmSlabAllocBuffer()
670 if (list == &header->slabs) { in wsbmSlabAllocBuffer()
671 WSBM_MUTEX_UNLOCK(&header->mutex); in wsbmSlabAllocBuffer()
681 WSBM_MUTEX_UNLOCK(&header->mutex); in wsbmSlabAllocBuffer()
697 struct _WsbmSlabSizeHeader *header; in pool_create() local
706 header = slabPool->headers; in pool_create()
708 if (header->bufSize >= size) in pool_create()
710 header++; in pool_create()
714 sBuf = wsbmSlabAllocBuffer(header); in pool_create()
798 struct _WsbmSlabSizeHeader *header; in pool_destroy() local
823 header = slab->header; in pool_destroy()
829 WSBM_MUTEX_LOCK(&header->mutex); in pool_destroy()
835 WSBMLISTADDTAIL(&sBuf->head, &header->delayedBuffers); in pool_destroy()
836 header->numDelayed++; in pool_destroy()
843 WSBM_MUTEX_UNLOCK(&header->mutex); in pool_destroy()
965 return sBuf->parent->header->bufSize; in pool_size()
1081 struct _WsbmSlabSizeHeader *header) in wsbmInitSizeHeader() argument
1083 WSBM_MUTEX_INIT(&header->mutex); in wsbmInitSizeHeader()
1084 WSBM_MUTEX_LOCK(&header->mutex); in wsbmInitSizeHeader()
1086 WSBMINITLISTHEAD(&header->slabs); in wsbmInitSizeHeader()
1087 WSBMINITLISTHEAD(&header->freeSlabs); in wsbmInitSizeHeader()
1088 WSBMINITLISTHEAD(&header->delayedBuffers); in wsbmInitSizeHeader()
1090 header->numDelayed = 0; in wsbmInitSizeHeader()
1091 header->slabPool = slabPool; in wsbmInitSizeHeader()
1092 header->bufSize = size; in wsbmInitSizeHeader()
1094 WSBM_MUTEX_UNLOCK(&header->mutex); in wsbmInitSizeHeader()
1098 wsbmFinishSizeHeader(struct _WsbmSlabSizeHeader *header) in wsbmFinishSizeHeader() argument
1103 WSBM_MUTEX_LOCK(&header->mutex); in wsbmFinishSizeHeader()
1104 WSBMLISTFOREACHSAFE(list, next, &header->delayedBuffers) { in wsbmFinishSizeHeader()
1111 header->numDelayed--; in wsbmFinishSizeHeader()
1114 WSBM_MUTEX_UNLOCK(&header->mutex); in wsbmFinishSizeHeader()
1115 WSBM_MUTEX_FREE(&header->mutex); in wsbmFinishSizeHeader()