Lines Matching refs:hashp
88 #define MRU hashp->bufhead.next
89 #define LRU hashp->bufhead.prev
91 #define MRU_INSERT(B) BUF_INSERT((B), &hashp->bufhead)
105 HTAB *hashp,
126 segment_ndx = addr & (hashp->SGSIZE - 1);
129 segp = hashp->dir[addr >> hashp->SSHIFT];
133 is_disk = is_disk_mask || !hashp->new_file;
137 bp = newbuf(hashp, addr, prev_bp);
139 __get_page(hashp, bp->page, addr, !prev_bp, is_disk, 0))
158 newbuf(HTAB *hashp, uint32_t addr, BUFHEAD *prev_bp)
173 if (hashp->nbufs || (bp->flags & BUF_PIN)) {
177 if ((bp->page = calloc(1, (size_t)hashp->BSIZE)) == NULL) {
181 if (hashp->nbufs)
182 hashp->nbufs--;
198 if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page,
210 segment_ndx = bp->addr & (hashp->SGSIZE - 1);
211 segp = hashp->dir[bp->addr >> hashp->SSHIFT];
214 if (hashp->new_file &&
240 if ((xbp->flags & BUF_MOD) && __put_page(hashp,
277 __buf_init(HTAB *hashp, u_int nbytes)
282 bfp = &(hashp->bufhead);
283 npages = (unsigned int)(nbytes + hashp->BSIZE - 1) >> hashp->BSHIFT;
286 hashp->nbufs = npages;
300 __buf_free(HTAB *hashp, int do_free, int to_disk)
307 for (bp = LRU; bp != &hashp->bufhead;) {
311 __put_page(hashp, bp->page,
318 (void)memset(bp->page, 0, (size_t)hashp->BSIZE);
331 __reclaim_buf(HTAB *hashp, BUFHEAD *bp)