Lines Matching defs:chp
96 get_cache(cache_t *cap, head_t *chp)
103 * ["chp"]. This routine follows the cache chain until it finds an
105 * and the cache-specific comparison ["chp->cmp"].
117 if ((x_dev == cap->dev) && (*chp->cmp)(cap)) {
126 cap->link[Prev] = (cache_t *)chp->aged;
127 cap->link[Next] = chp->aged[Frst];
128 chp->aged[Frst]->link[Prev] = cap;
129 chp->aged[Frst] = cap;
130 chp->hits += 1;
137 chp->searches += 1;
142 reclaim_cache(head_t *chp, int dev)
148 * the cache headed at "chp" and return the address of the
150 * elements on the cache headed at "chp" that belong to the
154 cache_t *cpp = (cache_t *)chp;
156 while ((cap = cpp->link[Prev]) != (cache_t *)chp) {
187 bkmem_free((caddr_t)cap, chp->size);
188 chp->count -= 1;
203 set_cache(cache_t **ccp, head_t *chp, int noreclaim)
208 * The caller passes the address of cache descriptor ["chp"] and the
217 if ((chp->count < chp->maxblks) &&
218 (cap = (cache_t *)bkmem_alloc(chp->size))) {
224 chp->count += 1;
236 cap = reclaim_cache(chp, -1);
237 chp->purges += 1;
240 bzero((char *)cap, chp->size);
243 cap->link[Prev] = (cache_t *)chp;
244 cap->link[Next] = chp->aged[Frst];