]> git.saurik.com Git - apple/libc.git/blob - db/mpool/FreeBSD/mpool.c.patch
Libc-498.tar.gz
[apple/libc.git] / db / mpool / FreeBSD / mpool.c.patch
1 --- mpool.c.orig 2006-12-13 22:19:43.000000000 -0800
2 +++ mpool.c 2006-12-13 22:27:26.000000000 -0800
3 @@ -294,10 +294,16 @@
4 BKT *bp;
5
6 /* Walk the lru chain, flushing any dirty pages to disk. */
7 - TAILQ_FOREACH(bp, &mp->lqh, q)
8 - if (bp->flags & MPOOL_DIRTY &&
9 - mpool_write(mp, bp) == RET_ERROR)
10 - return (RET_ERROR);
11 + TAILQ_FOREACH(bp, &mp->lqh, q) {
12 + if (bp->flags & MPOOL_DIRTY)
13 + if (mpool_write(mp, bp) == RET_ERROR) {
14 + return (RET_ERROR);
15 + } else {
16 + /* 4874757: Re-run through the user's pgin filter. */
17 + if (mp->pgin != NULL)
18 + (mp->pgin)(mp->pgcookie, bp->pgno, bp->page);
19 + }
20 + }
21
22 /* Sync the file descriptor. */
23 return (_fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);