1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Get rid of SetBufferWriteMode(), which was an accident waiting to happen.

In the event of an elog() while the mode was set to immediate write,
there was no way for it to be set back to the normal delayed write.
The mechanism was a waste of space and cycles anyway, since the only user
was varsup.c, which could perfectly well call FlushBuffer directly.
Now it does just that, and the notion of a write mode is gone.
This commit is contained in:
Tom Lane
2000-03-31 02:43:31 +00:00
parent 5717dcb8a7
commit ca05ba2a9d
3 changed files with 37 additions and 75 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.26 2000/01/26 05:56:04 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/transam/varsup.c,v 1.27 2000/03/31 02:43:31 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -88,7 +88,6 @@ VariableRelationPutNextXid(TransactionId xid)
{
Buffer buf;
VariableRelationContents var;
int flushmode;
/* ----------------
* We assume that a spinlock has been acquire to guarantee
@@ -105,7 +104,7 @@ VariableRelationPutNextXid(TransactionId xid)
/* ----------------
* read the variable page, update the nextXid field and
* write the page back out to disk.
* write the page back out to disk (with immediate write).
* ----------------
*/
buf = ReadBuffer(VariableRelation, 0);
@@ -120,9 +119,7 @@ VariableRelationPutNextXid(TransactionId xid)
TransactionIdStore(xid, &(var->nextXidData));
flushmode = SetBufferWriteMode(BUFFER_FLUSH_WRITE);
WriteBuffer(buf);
SetBufferWriteMode(flushmode);
FlushBuffer(buf, TRUE);
}
/* --------------------------------