Commit b00c2c1d authored by Vadim B. Mikheev's avatar Vadim B. Mikheev

FlushLocalBuffer () releases buffer only if required

by caller.
parent eb08b3ce
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.4 1996/11/10 03:02:18 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.5 1997/01/16 08:13:14 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -172,7 +172,7 @@ WriteLocalBuffer(Buffer buffer, bool release) ...@@ -172,7 +172,7 @@ WriteLocalBuffer(Buffer buffer, bool release)
* flushes a local buffer * flushes a local buffer
*/ */
int int
FlushLocalBuffer(Buffer buffer) FlushLocalBuffer(Buffer buffer, bool release)
{ {
int bufid; int bufid;
Relation bufrel; Relation bufrel;
...@@ -194,6 +194,7 @@ FlushLocalBuffer(Buffer buffer) ...@@ -194,6 +194,7 @@ FlushLocalBuffer(Buffer buffer)
(char *) MAKE_PTR(bufHdr->data)); (char *) MAKE_PTR(bufHdr->data));
Assert(LocalRefCount[bufid] > 0); Assert(LocalRefCount[bufid] > 0);
if ( release )
LocalRefCount[bufid]--; LocalRefCount[bufid]--;
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment