Skip to content
Snippets Groups Projects
Commit b00c2c1d authored by Vadim B. Mikheev's avatar Vadim B. Mikheev
Browse files

FlushLocalBuffer () releases buffer only if required

by caller.
parent eb08b3ce
No related branches found
No related tags found
No related merge requests found
...@@ -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,7 +194,8 @@ FlushLocalBuffer(Buffer buffer) ...@@ -194,7 +194,8 @@ FlushLocalBuffer(Buffer buffer)
(char *) MAKE_PTR(bufHdr->data)); (char *) MAKE_PTR(bufHdr->data));
Assert(LocalRefCount[bufid] > 0); Assert(LocalRefCount[bufid] > 0);
LocalRefCount[bufid]--; if ( release )
LocalRefCount[bufid]--;
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment