diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-06-12 09:12:31 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-06-12 09:12:31 +0000 |
commit | a213f1ee6c5a1bbe1f074ca201975e76ad2ed50c (patch) | |
tree | c5ac3531c006389123da3ba506e5b25eb09ecd02 /src/backend/storage/buffer/localbuf.c | |
parent | c4f2a0458dc029d1214f013f1434f70f5194e56d (diff) | |
download | postgresql-a213f1ee6c5a1bbe1f074ca201975e76ad2ed50c.tar.gz postgresql-a213f1ee6c5a1bbe1f074ca201975e76ad2ed50c.zip |
Refactor XLogOpenRelation() and XLogReadBuffer() in preparation for relation
forks. XLogOpenRelation() and the associated light-weight relation cache in
xlogutils.c is gone, and XLogReadBuffer() now takes a RelFileNode as argument,
instead of Relation.
For functions that still need a Relation struct during WAL replay, there's a
new function called CreateFakeRelcacheEntry() that returns a fake entry like
XLogOpenRelation() used to.
Diffstat (limited to 'src/backend/storage/buffer/localbuf.c')
-rw-r--r-- | src/backend/storage/buffer/localbuf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/storage/buffer/localbuf.c b/src/backend/storage/buffer/localbuf.c index a6f76f5689e..ae5f3049a5f 100644 --- a/src/backend/storage/buffer/localbuf.c +++ b/src/backend/storage/buffer/localbuf.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.79 2008/01/01 19:45:51 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.80 2008/06/12 09:12:31 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -61,7 +61,7 @@ static Block GetLocalBufferStorage(void); * (hence, usage_count is always advanced). */ BufferDesc * -LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr) +LocalBufferAlloc(SMgrRelation smgr, BlockNumber blockNum, bool *foundPtr) { BufferTag newTag; /* identity of requested block */ LocalBufferLookupEnt *hresult; @@ -70,7 +70,7 @@ LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr) int trycounter; bool found; - INIT_BUFFERTAG(newTag, reln, blockNum); + INIT_BUFFERTAG(newTag, smgr->smgr_rnode, blockNum); /* Initialize local buffers if first request in this session */ if (LocalBufHash == NULL) @@ -87,7 +87,7 @@ LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr) Assert(BUFFERTAGS_EQUAL(bufHdr->tag, newTag)); #ifdef LBDEBUG fprintf(stderr, "LB ALLOC (%u,%d) %d\n", - RelationGetRelid(reln), blockNum, -b - 1); + smgr->smgr_rnode.relNode, blockNum, -b - 1); #endif /* this part is equivalent to PinBuffer for a shared buffer */ if (LocalRefCount[b] == 0) |