Lines Matching refs:hashp

86 #define	MRU	hashp->bufhead.next
87 #define LRU hashp->bufhead.prev
89 #define MRU_INSERT(B) BUF_INSERT((B), &hashp->bufhead)
110 __get_buf(HTAB *hashp, in __get_buf() argument
130 segment_ndx = addr & (hashp->SGSIZE - 1); in __get_buf()
133 segp = hashp->dir[addr >> hashp->SSHIFT]; in __get_buf()
139 is_disk = is_disk_mask || !hashp->new_file; in __get_buf()
143 bp = newbuf(hashp, addr, prev_bp); in __get_buf()
145 __get_page(hashp, bp->page, addr, !prev_bp, is_disk, 0)) in __get_buf()
164 newbuf(HTAB *hashp, in newbuf() argument
181 if (hashp->nbufs || (bp->flags & BUF_PIN)) { in newbuf()
188 if ((bp->page = (char *)malloc(hashp->BSIZE)) == NULL) { in newbuf()
193 memset(bp->page, 0xff, hashp->BSIZE); in newbuf()
195 if (hashp->nbufs) in newbuf()
196 hashp->nbufs--; in newbuf()
212 if ((bp->flags & BUF_MOD) && __put_page(hashp, bp->page, in newbuf()
224 segment_ndx = bp->addr & (hashp->SGSIZE - 1); in newbuf()
225 segp = hashp->dir[bp->addr >> hashp->SSHIFT]; in newbuf()
230 if (hashp->new_file && in newbuf()
256 if ((xbp->flags & BUF_MOD) && __put_page(hashp, in newbuf()
293 __buf_init(HTAB *hashp, int nbytes) in __buf_init() argument
298 bfp = &(hashp->bufhead); in __buf_init()
299 npages = (nbytes + hashp->BSIZE - 1) >> hashp->BSHIFT; in __buf_init()
302 hashp->nbufs = npages; in __buf_init()
316 __buf_free(HTAB *hashp, int do_free, int to_disk) in __buf_free() argument
323 for (bp = LRU; bp != &hashp->bufhead;) { in __buf_free()
327 __put_page(hashp, bp->page, in __buf_free()
345 __reclaim_buf(HTAB *hashp, BUFHEAD *bp) in __reclaim_buf() argument