Lines Matching refs:bp
83 if (((*cp)->bp = in init_cache()
84 (Bucket *) malloc(sizeof (*(*cp)->bp) * hsz)) == NULL) { in init_cache()
92 bzero((*cp)->bp, sizeof (*(*cp)->bp) * hsz); in init_cache()
111 Bucket *bp; in add_cache() local
121 bp = &cp->bp[(*cp->hfunc)(itemp->key, itemp->keyl, cp->hsz)]; in add_cache()
122 if (bp->nent >= bp->nalloc) { in add_cache()
123 if (bp->nalloc == 0) { in add_cache()
124 bp->itempp = in add_cache()
125 (Item **) malloc(sizeof (*bp->itempp) * cp->bsz); in add_cache()
130 bp->nalloc + cp->bsz, in add_cache()
134 (Item **) malloc(sizeof (*bp->itempp) * in add_cache()
135 (bp->nalloc + cp->bsz))) != NULL) { in add_cache()
136 bcopy((char *)bp->itempp, (char *)titempp, in add_cache()
137 (sizeof (*bp->itempp) * bp->nalloc)); in add_cache()
139 bkmem_free(bp->itempp, in add_cache()
140 (sizeof (*bp->itempp) * bp->nalloc)); in add_cache()
142 free(bp->itempp); in add_cache()
144 bp->itempp = titempp; in add_cache()
146 bp->itempp = NULL; in add_cache()
148 if (bp->itempp == NULL) { in add_cache()
153 bp->nalloc += cp->bsz; in add_cache()
155 bp->itempp[bp->nent] = itemp; in add_cache()
156 bp->nent++; in add_cache()
164 Bucket *bp; in lookup_cache() local
174 bp = &cp->bp[(*cp->hfunc)(datap, datalen, cp->hsz)]; in lookup_cache()
176 for (i = 0; i < bp->nent; i++) { in lookup_cache()
177 if (!(*cp->cfunc)((void *)bp->itempp[i]->key, datap, datalen)) { in lookup_cache()
178 return (bp->itempp[i]); in lookup_cache()