mp 83 libdb/mpool.c MPOOL *mp; mp 100 libdb/mpool.c if ((mp = (MPOOL *)calloc(1, sizeof(MPOOL))) == NULL) mp 102 libdb/mpool.c CIRCLEQ_INIT(&mp->lqh); mp 104 libdb/mpool.c CIRCLEQ_INIT(&mp->hqh[entry]); mp 105 libdb/mpool.c mp->maxcache = maxcache; mp 106 libdb/mpool.c mp->npages = sb.st_size / pagesize; mp 107 libdb/mpool.c mp->pagesize = pagesize; mp 108 libdb/mpool.c mp->fd = fd; mp 109 libdb/mpool.c return (mp); mp 122 libdb/mpool.c mpool_filter(mp, pgin, pgout, pgcookie) mp 123 libdb/mpool.c MPOOL *mp; mp 128 libdb/mpool.c mp->pgin = pgin; mp 129 libdb/mpool.c mp->pgout = pgout; mp 130 libdb/mpool.c mp->pgcookie = pgcookie; mp 141 libdb/mpool.c mpool_new(mp, pgnoaddr) mp 142 libdb/mpool.c MPOOL *mp; mp 148 libdb/mpool.c if (mp->npages == MAX_PAGE_NUMBER) { mp 153 libdb/mpool.c ++mp->pagenew; mp 160 libdb/mpool.c if ((bp = mpool_bkt(mp)) == NULL) mp 162 libdb/mpool.c *pgnoaddr = bp->pgno = mp->npages++; mp 165 libdb/mpool.c head = &mp->hqh[HASHKEY(bp->pgno)]; mp 167 libdb/mpool.c CIRCLEQ_INSERT_TAIL(&mp->lqh, bp, q); mp 180 libdb/mpool.c mpool_get(mp, pgno, flags) mp 181 libdb/mpool.c MPOOL *mp; mp 191 libdb/mpool.c if (pgno >= mp->npages) { mp 197 libdb/mpool.c ++mp->pageget; mp 201 libdb/mpool.c if ((bp = mpool_look(mp, pgno)) != NULL) { mp 213 libdb/mpool.c head = &mp->hqh[HASHKEY(bp->pgno)]; mp 216 libdb/mpool.c CIRCLEQ_REMOVE(&mp->lqh, bp, q); mp 217 libdb/mpool.c CIRCLEQ_INSERT_TAIL(&mp->lqh, bp, q); mp 225 libdb/mpool.c if ((bp = mpool_bkt(mp)) == NULL) mp 230 libdb/mpool.c ++mp->pageread; mp 232 libdb/mpool.c off = mp->pagesize * pgno; mp 234 libdb/mpool.c if ((nr = pread(mp->fd, bp->page, mp->pagesize, off)) != mp->pagesize) { mp 240 libdb/mpool.c if (lseek(mp->fd, off, SEEK_SET) != off) mp 242 libdb/mpool.c if ((nr = read(mp->fd, bp->page, mp->pagesize)) != mp->pagesize) { mp 257 libdb/mpool.c head = &mp->hqh[HASHKEY(bp->pgno)]; mp 259 libdb/mpool.c CIRCLEQ_INSERT_TAIL(&mp->lqh, bp, q); mp 262 libdb/mpool.c if (mp->pgin != NULL) mp 263 libdb/mpool.c (mp->pgin)(mp->pgcookie, bp->pgno, bp->page); mp 277 libdb/mpool.c mpool_put(mp, page, flags) mp 278 libdb/mpool.c MPOOL *mp; mp 285 libdb/mpool.c ++mp->pageput; mp 307 libdb/mpool.c mpool_close(mp) mp 308 libdb/mpool.c MPOOL *mp; mp 313 libdb/mpool.c while ((bp = mp->lqh.cqh_first) != (void *)&mp->lqh) { mp 314 libdb/mpool.c CIRCLEQ_REMOVE(&mp->lqh, mp->lqh.cqh_first, q); mp 319 libdb/mpool.c free(mp); mp 330 libdb/mpool.c mpool_sync(mp) mp 331 libdb/mpool.c MPOOL *mp; mp 336 libdb/mpool.c for (bp = mp->lqh.cqh_first; mp 337 libdb/mpool.c bp != (void *)&mp->lqh; bp = bp->q.cqe_next) mp 339 libdb/mpool.c mpool_write(mp, bp) == RET_ERROR) mp 343 libdb/mpool.c return (fsync(mp->fd) ? RET_ERROR : RET_SUCCESS); mp 353 libdb/mpool.c mpool_bkt(mp) mp 354 libdb/mpool.c MPOOL *mp; mp 360 libdb/mpool.c if (mp->curcache < mp->maxcache) mp 369 libdb/mpool.c for (bp = mp->lqh.cqh_first; mp 370 libdb/mpool.c bp != (void *)&mp->lqh; bp = bp->q.cqe_next) mp 374 libdb/mpool.c mpool_write(mp, bp) == RET_ERROR) mp 377 libdb/mpool.c ++mp->pageflush; mp 380 libdb/mpool.c head = &mp->hqh[HASHKEY(bp->pgno)]; mp 382 libdb/mpool.c CIRCLEQ_REMOVE(&mp->lqh, bp, q); mp 386 libdb/mpool.c memset(bp, 0xff, sizeof(BKT) + mp->pagesize); mp 393 libdb/mpool.c new: if ((bp = (BKT *)malloc(sizeof(BKT) + mp->pagesize)) == NULL) mp 396 libdb/mpool.c ++mp->pagealloc; mp 399 libdb/mpool.c memset(bp, 0xff, sizeof(BKT) + mp->pagesize); mp 402 libdb/mpool.c ++mp->curcache; mp 414 libdb/mpool.c mpool_write(mp, bp) mp 415 libdb/mpool.c MPOOL *mp; mp 421 libdb/mpool.c ++mp->pagewrite; mp 425 libdb/mpool.c if (mp->pgout) mp 426 libdb/mpool.c (mp->pgout)(mp->pgcookie, bp->pgno, bp->page); mp 428 libdb/mpool.c off = mp->pagesize * bp->pgno; mp 430 libdb/mpool.c if (pwrite(mp->fd, bp->page, mp->pagesize, off) != mp->pagesize) mp 433 libdb/mpool.c if (lseek(mp->fd, off, SEEK_SET) != off) mp 435 libdb/mpool.c if (write(mp->fd, bp->page, mp->pagesize) != mp->pagesize) mp 451 libdb/mpool.c mpool_look(mp, pgno) mp 452 libdb/mpool.c MPOOL *mp; mp 458 libdb/mpool.c head = &mp->hqh[HASHKEY(pgno)]; mp 462 libdb/mpool.c ++mp->cachehit; mp 467 libdb/mpool.c ++mp->cachemiss; mp 480 libdb/mpool.c mpool_stat(mp) mp 481 libdb/mpool.c MPOOL *mp; mp 487 libdb/mpool.c (void)fprintf(stderr, "%lu pages in the file\n", (long unsigned int)mp->npages); mp 490 libdb/mpool.c mp->pagesize, (long unsigned int)mp->curcache, (long unsigned int)mp->maxcache); mp 492 libdb/mpool.c mp->pageput, mp->pageget, mp->pagenew); mp 494 libdb/mpool.c mp->pagealloc, mp->pageflush); mp 495 libdb/mpool.c if (mp->cachehit + mp->cachemiss) mp 498 libdb/mpool.c ((double)mp->cachehit / (mp->cachehit + mp->cachemiss)) mp 499 libdb/mpool.c * 100, mp->cachehit, mp->cachemiss); mp 501 libdb/mpool.c mp->pageread, mp->pagewrite); mp 505 libdb/mpool.c for (bp = mp->lqh.cqh_first; mp 506 libdb/mpool.c bp != (void *)&mp->lqh; bp = bp->q.cqe_next) {