*** mp/mp_fput.c.orig Tue Dec 15 09:57:18 1998 --- mp/mp_fput.c Fri Aug 27 17:37:03 1999 *************** *** 119,124 **** --- 119,131 ---- return (0); } + /* Move the buffer to the head/tail of the LRU chain. */ + SH_TAILQ_REMOVE(&mp->bhq, bhp, q, __bh); + if (F_ISSET(bhp, BH_DISCARD)) + SH_TAILQ_INSERT_HEAD(&mp->bhq, bhp, q, __bh); + else + SH_TAILQ_INSERT_TAIL(&mp->bhq, bhp, q); + /* * If this buffer is scheduled for writing because of a checkpoint, we * need to write it (if we marked it dirty), or update the checkpoint *************** *** 138,151 **** --dbmfp->mfp->lsn_cnt; --mp->lsn_cnt; } - - /* Move the buffer to the head/tail of the LRU chain. */ - SH_TAILQ_REMOVE(&mp->bhq, bhp, q, __bh); - if (F_ISSET(bhp, BH_DISCARD)) - SH_TAILQ_INSERT_HEAD(&mp->bhq, bhp, q, __bh); - else - SH_TAILQ_INSERT_TAIL(&mp->bhq, bhp, q); - UNLOCKREGION(dbmp); return (0); --- 145,150 ---- *** mp/mp_region.c.orig Fri Dec 11 14:29:42 1998 --- mp/mp_region.c Fri Aug 27 17:37:03 1999 *************** *** 137,145 **** --- 137,147 ---- * the buffer list. */ if (F_ISSET(bhp, BH_DIRTY)) { + ++bhp->ref; if ((ret = __memp_bhwrite(dbmp, mfp, bhp, &restart, &wrote)) != 0) return (ret); + --bhp->ref; /* * It's possible that another process wants this buffer *** mp/mp_sync.c.orig Mon Apr 12 12:07:38 1999 --- mp/mp_sync.c Fri Aug 27 17:37:03 1999 *************** *** 446,451 **** --- 446,452 ---- BH *bhp; MPOOL *mp; MPOOLFILE *mfp; + db_pgno_t pgno; u_long total; int ret, wrote; *************** *** 493,498 **** --- 494,500 ---- if (F_ISSET(mfp, MP_TEMP)) continue; + pgno = bhp->pgno; if ((ret = __memp_bhwrite(dbmp, mfp, bhp, NULL, &wrote)) != 0) goto err; *************** *** 503,509 **** */ if (!wrote) { __db_err(dbmp->dbenv, "%s: unable to flush page: %lu", ! __memp_fns(dbmp, mfp), (u_long)bhp->pgno); ret = EPERM; goto err; } --- 505,511 ---- */ if (!wrote) { __db_err(dbmp->dbenv, "%s: unable to flush page: %lu", ! __memp_fns(dbmp, mfp), (u_long)pgno); ret = EPERM; goto err; }