Lines Matching defs:hashp
84 #define MRU hashp->bufhead.next
85 #define LRU hashp->bufhead.prev
87 #define MRU_INSERT(B) BUF_INSERT((B), &hashp->bufhead)
100 __get_buf(HTAB *hashp, u_int32_t addr,
119 segment_ndx = addr & (hashp->SGSIZE - 1);
122 segp = hashp->dir[addr >> hashp->SSHIFT];
128 is_disk = is_disk_mask || !hashp->new_file;
132 bp = newbuf(hashp, addr, prev_bp);
134 __get_page(hashp, bp->page, addr, !prev_bp, is_disk, 0))
153 newbuf(HTAB *hashp, u_int32_t addr, BUFHEAD *prev_bp)
166 if (bp == hashp->cpage) {
173 if (hashp->nbufs == 0 && prev_bp && bp->ovfl) {
178 hashp->nbufs++;
188 if (hashp->nbufs || (bp->flags & BUF_PIN) || bp == hashp->cpage) {
193 if ((bp->page = (char *)malloc(hashp->BSIZE)) == NULL) {
197 memset(bp->page, 0xff, hashp->BSIZE);
198 if (hashp->nbufs)
199 hashp->nbufs--;
215 if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page,
227 segment_ndx = bp->addr & (hashp->SGSIZE - 1);
228 segp = hashp->dir[bp->addr >> hashp->SSHIFT];
233 if (hashp->new_file &&
259 if ((xbp->flags & BUF_MOD) && __put_page(hashp,
296 __buf_init(HTAB *hashp, int nbytes)
301 bfp = &(hashp->bufhead);
302 npages = (nbytes + hashp->BSIZE - 1) >> hashp->BSHIFT;
305 hashp->nbufs = npages;
319 __buf_free(HTAB *hashp, int do_free, int to_disk)
326 for (bp = LRU; bp != &hashp->bufhead;) {
330 __put_page(hashp, bp->page,
337 (void)memset(bp->page, 0, hashp->BSIZE);
350 __reclaim_buf(HTAB *hashp, BUFHEAD *bp)