aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-02-26 04:46:47 +0000
committerBruce Momjian <bruce@momjian.us>1998-02-26 04:46:47 +0000
commita32450a5855eed4bfd756ef292ee45d3c754665b (patch)
tree26735c3406d9f46d0f39accbe6ff1fb5cc5beedc /src/backend/storage/buffer
parent757bf69a2e259c76baed94fa06e792664ab5ed67 (diff)
downloadpostgresql-a32450a5855eed4bfd756ef292ee45d3c754665b.tar.gz
postgresql-a32450a5855eed4bfd756ef292ee45d3c754665b.zip
pgindent run before 6.3 release, with Thomas' requested changes.
Diffstat (limited to 'src/backend/storage/buffer')
-rw-r--r--src/backend/storage/buffer/bufmgr.c52
-rw-r--r--src/backend/storage/buffer/localbuf.c6
-rw-r--r--src/backend/storage/buffer/s_lock.c29
3 files changed, 45 insertions, 42 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 2ff414bcbbd..29476547c1f 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.34 1998/02/11 19:11:42 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/bufmgr.c,v 1.35 1998/02/26 04:35:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -100,7 +100,7 @@ static void BufferSync(void);
static int BufferReplace(BufferDesc *bufHdr, bool bufferLockHeld);
/* not static but used by vacuum only ... */
-int BlowawayRelationBuffers(Relation rdesc, BlockNumber block);
+int BlowawayRelationBuffers(Relation rdesc, BlockNumber block);
/* ---------------------------------------------------
* RelationGetBufferWithBuffer
@@ -829,7 +829,7 @@ FlushBuffer(Buffer buffer, bool release)
status = smgrflush(DEFAULT_SMGR, bufrel, bufHdr->tag.blockNum,
(char *) MAKE_PTR(bufHdr->data));
-
+
RelationDecrementReferenceCount(bufrel);
if (status == SM_FAIL)
@@ -1197,7 +1197,7 @@ ResetBufferUsage()
void
ResetBufferPool()
{
- int i;
+ int i;
for (i = 1; i <= NBuffers; i++)
{
@@ -1225,7 +1225,7 @@ ResetBufferPool()
int
BufferPoolCheckLeak()
{
- int i;
+ int i;
int error = 0;
for (i = 1; i <= NBuffers; i++)
@@ -1384,7 +1384,7 @@ BufferReplace(BufferDesc *bufHdr, bool bufferLockHeld)
bufHdr->tag.blockNum,
(char *) MAKE_PTR(bufHdr->data));
}
-
+
if (reln != (Relation) NULL)
RelationDecrementReferenceCount(reln);
@@ -1444,7 +1444,7 @@ BufferGetBlock(Buffer buffer)
void
ReleaseRelationBuffers(Relation rdesc)
{
- int i;
+ int i;
int holding = 0;
BufferDesc *buf;
@@ -1501,7 +1501,7 @@ ReleaseRelationBuffers(Relation rdesc)
void
DropBuffers(Oid dbid)
{
- int i;
+ int i;
BufferDesc *buf;
SpinAcquire(BufMgrLock);
@@ -1587,7 +1587,7 @@ blockNum=%d, flags=0x%x, refcount=%d %d)\n",
void
BufferPoolBlowaway()
{
- int i;
+ int i;
BufferSync();
for (i = 1; i <= NBuffers; i++)
@@ -1608,9 +1608,9 @@ BufferPoolBlowaway()
*
* This function blowaway all the pages with blocknumber >= passed
* of a relation in the buffer pool. Used by vacuum before truncation...
- *
+ *
* Returns: 0 - Ok, -1 - DIRTY, -2 - PINNED
- *
+ *
* XXX currently it sequentially searches the buffer pool, should be
* changed to more clever ways of searching.
* --------------------------------------------------------------------
@@ -1618,28 +1618,28 @@ BufferPoolBlowaway()
int
BlowawayRelationBuffers(Relation rdesc, BlockNumber block)
{
- int i;
- BufferDesc *buf;
+ int i;
+ BufferDesc *buf;
if (rdesc->rd_islocal)
{
for (i = 0; i < NLocBuffer; i++)
{
buf = &LocalBufferDescriptors[i];
- if (buf->tag.relId.relId == rdesc->rd_id &&
+ if (buf->tag.relId.relId == rdesc->rd_id &&
buf->tag.blockNum >= block)
{
if (buf->flags & BM_DIRTY)
{
- elog (NOTICE, "BlowawayRelationBuffers(%s (local), %u): block %u is dirty",
- rdesc->rd_rel->relname.data, block, buf->tag.blockNum);
+ elog(NOTICE, "BlowawayRelationBuffers(%s (local), %u): block %u is dirty",
+ rdesc->rd_rel->relname.data, block, buf->tag.blockNum);
return (-1);
}
if (LocalRefCount[i] > 0)
{
- elog (NOTICE, "BlowawayRelationBuffers(%s (local), %u): block %u is referenced (%d)",
- rdesc->rd_rel->relname.data, block,
- buf->tag.blockNum, LocalRefCount[i]);
+ elog(NOTICE, "BlowawayRelationBuffers(%s (local), %u): block %u is referenced (%d)",
+ rdesc->rd_rel->relname.data, block,
+ buf->tag.blockNum, LocalRefCount[i]);
return (-2);
}
buf->tag.relId.relId = InvalidOid;
@@ -1653,22 +1653,22 @@ BlowawayRelationBuffers(Relation rdesc, BlockNumber block)
{
buf = &BufferDescriptors[i];
if (buf->tag.relId.dbId == MyDatabaseId &&
- buf->tag.relId.relId == rdesc->rd_id &&
+ buf->tag.relId.relId == rdesc->rd_id &&
buf->tag.blockNum >= block)
{
if (buf->flags & BM_DIRTY)
{
- elog (NOTICE, "BlowawayRelationBuffers(%s, %u): block %u is dirty (private %d, last %d, global %d)",
- buf->sb_relname, block, buf->tag.blockNum,
- PrivateRefCount[i], LastRefCount[i], buf->refcount);
+ elog(NOTICE, "BlowawayRelationBuffers(%s, %u): block %u is dirty (private %d, last %d, global %d)",
+ buf->sb_relname, block, buf->tag.blockNum,
+ PrivateRefCount[i], LastRefCount[i], buf->refcount);
SpinRelease(BufMgrLock);
return (-1);
}
if (!(buf->flags & BM_FREE))
{
- elog (NOTICE, "BlowawayRelationBuffers(%s, %u): block %u is referenced (private %d, last %d, global %d)",
- buf->sb_relname, block, buf->tag.blockNum,
- PrivateRefCount[i], LastRefCount[i], buf->refcount);
+ elog(NOTICE, "BlowawayRelationBuffers(%s, %u): block %u is referenced (private %d, last %d, global %d)",
+ buf->sb_relname, block, buf->tag.blockNum,
+ PrivateRefCount[i], LastRefCount[i], buf->refcount);
SpinRelease(BufMgrLock);
return (-2);
}
diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c
index 8c13462167b..3d05dc4b855 100644
--- a/src/backend/storage/buffer/localbuf.c
+++ b/src/backend/storage/buffer/localbuf.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.17 1998/01/13 04:04:20 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.18 1998/02/26 04:35:26 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -205,7 +205,7 @@ FlushLocalBuffer(Buffer buffer, bool release)
(char *) MAKE_PTR(bufHdr->data));
LocalBufferFlushCount++;
RelationDecrementReferenceCount(bufrel);
-
+
Assert(LocalRefCount[bufid] > 0);
if (release)
LocalRefCount[bufid]--;
@@ -279,7 +279,7 @@ LocalBufferSync(void)
(char *) MAKE_PTR(buf->data));
LocalBufferFlushCount++;
RelationDecrementReferenceCount(bufrel);
-
+
buf->tag.relId.relId = InvalidOid;
buf->flags &= ~BM_DIRTY;
}
diff --git a/src/backend/storage/buffer/s_lock.c b/src/backend/storage/buffer/s_lock.c
index 493139ed5dc..1a194eb4a41 100644
--- a/src/backend/storage/buffer/s_lock.c
+++ b/src/backend/storage/buffer/s_lock.c
@@ -7,15 +7,15 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/s_lock.c,v 1.2 1998/01/07 17:02:52 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/s_lock.c,v 1.3 1998/02/26 04:35:28 momjian Exp $
*
*-------------------------------------------------------------------------
*/
/*
* S_LOCK() -- Implements the S_LOCK function for the Linux/Alpha platform.
- * This function is usually an inlined macro for all other platforms,
- * but must be a seperate function for the Linux/Alpha platform, due
- * to the assembly code involved.
+ * This function is usually an inlined macro for all other platforms,
+ * but must be a seperate function for the Linux/Alpha platform, due
+ * to the assembly code involved.
*/
@@ -38,14 +38,16 @@
#include "storage/s_lock.h"
#if defined(__alpha__) && defined(linux)
-void S_LOCK(slock_t* lock)
+void
+S_LOCK(slock_t *lock)
{
- do
- {
- slock_t _res;
- do
- {
- __asm__(" ldq $0, %0 \n\
+ do
+ {
+ slock_t _res;
+
+ do
+ {
+ __asm__(" ldq $0, %0 \n\
bne $0, already_set \n\
ldq_l $0, %0 \n\
bne $0, already_set \n\
@@ -58,7 +60,8 @@ void S_LOCK(slock_t* lock)
stqc_fail: or $31, 1, $0 \n\
already_set: bis $0, $0, %1 \n\
end: nop ": "=m"(*lock), "=r"(_res): :"0");
- } while (_res != 0);
- } while (0);
+ } while (_res != 0);
+ } while (0);
}
+
#endif