1 --- mpool.c.orig 2009-11-06 12:36:03.000000000 -0800
2 +++ mpool.c 2009-11-06 12:36:15.000000000 -0800
3 @@ -119,7 +119,7 @@ mpool_new(mp, pgnoaddr)
5 if (mp->npages == MAX_PAGE_NUMBER) {
6 (void)fprintf(stderr, "mpool_new: page allocation overflow.\n");
8 + LIBC_ABORT("page allocation overflow");
12 @@ -170,7 +170,7 @@ mpool_get(MPOOL *mp, pgno_t pgno,
13 if (bp->flags & MPOOL_PINNED) {
15 "mpool_get: page %d already pinned\n", bp->pgno);
17 + LIBC_ABORT("page %d already pinned", bp->pgno);
21 @@ -241,7 +241,7 @@ mpool_put(MPOOL *mp, void *page, u_int f
22 if (!(bp->flags & MPOOL_PINNED)) {
24 "mpool_put: page %d not pinned\n", bp->pgno);
26 + LIBC_ABORT("page %d not pinned", bp->pgno);
29 bp->flags &= ~MPOOL_PINNED;
30 @@ -280,10 +280,16 @@ mpool_sync(MPOOL *mp)
33 /* Walk the lru chain, flushing any dirty pages to disk. */
34 - TAILQ_FOREACH(bp, &mp->lqh, q)
35 - if (bp->flags & MPOOL_DIRTY &&
36 - mpool_write(mp, bp) == RET_ERROR)
38 + TAILQ_FOREACH(bp, &mp->lqh, q) {
39 + if (bp->flags & MPOOL_DIRTY)
40 + if (mpool_write(mp, bp) == RET_ERROR) {
43 + /* 4874757: Re-run through the user's pgin filter. */
44 + if (mp->pgin != NULL)
45 + (mp->pgin)(mp->pgcookie, bp->pgno, bp->page);
49 /* Sync the file descriptor. */
50 return (_fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);