From fef0c8345a96f953ebfe59fcc22a9eeb980b25c5 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Sun, 14 Dec 2003 00:34:47 +0000 Subject: I posted some bufmgr cleanup a few weeks ago, but it conflicted with some concurrent changes Jan was making to the bufmgr. Here's an updated version of the patch -- it should apply cleanly to CVS HEAD and passes the regression tests. This patch makes the following changes: - remove the UnlockAndReleaseBuffer() and UnlockAndWriteBuffer() macros, and replace uses of them with calls to the appropriate functions. - remove a bunch of #ifdef BMTRACE code: it is ugly & broken (i.e. it doesn't compile) - make BufferReplace() return a bool, not an int - cleanup some logic in bufmgr.c; should be functionality equivalent to the previous code, just cleaner now - remove the BM_PRIVATE flag as it is unused - improve a few comments, etc. --- src/backend/access/transam/xlog.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/backend/access/transam/xlog.c') diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 9aa19ea5945..794e392f78d 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.127 2003/12/12 18:45:08 petere Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.128 2003/12/14 00:34:47 neilc Exp $ * *------------------------------------------------------------------------- */ @@ -1712,7 +1712,8 @@ RestoreBkpBlocks(XLogRecord *record, XLogRecPtr lsn) memcpy((char *) page, blk, BLCKSZ); PageSetLSN(page, lsn); PageSetSUI(page, ThisStartUpID); - UnlockAndWriteBuffer(buffer); + LockBuffer(buffer, BUFFER_LOCK_UNLOCK); + WriteBuffer(buffer); } } -- cgit v1.2.3