aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/localbuf.c
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>2000-10-23 04:10:24 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>2000-10-23 04:10:24 +0000
commit4b65a2840b124b881ce4f260f9cc35927863b2ae (patch)
tree0b4f2cb3b57ca6246d450984401d72a9eabebc62 /src/backend/storage/buffer/localbuf.c
parentc82c9559a771f58dc42ce93f227cccd368eb46e6 (diff)
downloadpostgresql-4b65a2840b124b881ce4f260f9cc35927863b2ae.tar.gz
postgresql-4b65a2840b124b881ce4f260f9cc35927863b2ae.zip
New relcache hash table with RelFileNode as key to be used
from bufmgr - it would be nice to have separate hash in smgr for node <--> fd mappings, but for the moment it's easy to add new hash to relcache. Fixed small bug in xlog.c:ReadRecord.
Diffstat (limited to 'src/backend/storage/buffer/localbuf.c')
-rw-r--r--src/backend/storage/buffer/localbuf.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c
index 3cb8f572b89..1d6a416e48e 100644
--- a/src/backend/storage/buffer/localbuf.c
+++ b/src/backend/storage/buffer/localbuf.c
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.31 2000/10/18 05:50:15 vadim Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/localbuf.c,v 1.32 2000/10/23 04:10:06 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@@ -103,7 +103,7 @@ LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr)
*/
if (bufHdr->flags & BM_DIRTY)
{
- Relation bufrel = RelationIdCacheGetRelation(bufHdr->relId.relId);
+ Relation bufrel = RelationNodeCacheGetRelation(bufHdr->tag.rnode);
Assert(bufrel != NULL);
@@ -127,7 +127,6 @@ LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr)
*/
bufHdr->tag.rnode = reln->rd_node;
bufHdr->tag.blockNum = blockNum;
- bufHdr->relId = reln->rd_lockInfo.lockRelId;
bufHdr->flags &= ~BM_DIRTY;
/*
@@ -192,7 +191,7 @@ FlushLocalBuffer(Buffer buffer, bool release)
bufid = -(buffer + 1);
bufHdr = &LocalBufferDescriptors[bufid];
bufHdr->flags &= ~BM_DIRTY;
- bufrel = RelationIdCacheGetRelation(bufHdr->relId.relId);
+ bufrel = RelationNodeCacheGetRelation(bufHdr->tag.rnode);
Assert(bufrel != NULL);
smgrflush(DEFAULT_SMGR, bufrel, bufHdr->tag.blockNum,
@@ -268,7 +267,7 @@ LocalBufferSync(void)
#ifdef LBDEBUG
fprintf(stderr, "LB SYNC %d\n", -i - 1);
#endif
- bufrel = RelationIdCacheGetRelation(buf->relId.relId);
+ bufrel = RelationNodeCacheGetRelation(buf->tag.rnode);
Assert(bufrel != NULL);
@@ -279,7 +278,6 @@ LocalBufferSync(void)
/* drop relcache refcount from RelationIdCacheGetRelation */
RelationDecrementReferenceCount(bufrel);
- buf->relId.relId = InvalidOid;
buf->flags &= ~BM_DIRTY;
}
}