From a213f1ee6c5a1bbe1f074ca201975e76ad2ed50c Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Thu, 12 Jun 2008 09:12:31 +0000 Subject: 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. --- src/include/storage/buf_internals.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/include/storage/buf_internals.h') diff --git a/src/include/storage/buf_internals.h b/src/include/storage/buf_internals.h index 5178a4d5dc2..472e64de1bd 100644 --- a/src/include/storage/buf_internals.h +++ b/src/include/storage/buf_internals.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/buf_internals.h,v 1.95 2008/01/01 19:45:58 momjian Exp $ + * $PostgreSQL: pgsql/src/include/storage/buf_internals.h,v 1.96 2008/06/12 09:12:31 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -18,6 +18,7 @@ #include "storage/buf.h" #include "storage/lwlock.h" #include "storage/shmem.h" +#include "storage/smgr.h" #include "storage/spin.h" #include "utils/rel.h" @@ -75,9 +76,9 @@ typedef struct buftag (a).blockNum = InvalidBlockNumber \ ) -#define INIT_BUFFERTAG(a,xx_reln,xx_blockNum) \ +#define INIT_BUFFERTAG(a,xx_rnode,xx_blockNum) \ ( \ - (a).rnode = (xx_reln)->rd_node, \ + (a).rnode = (xx_rnode), \ (a).blockNum = (xx_blockNum) \ ) @@ -201,7 +202,7 @@ extern int BufTableInsert(BufferTag *tagPtr, uint32 hashcode, int buf_id); extern void BufTableDelete(BufferTag *tagPtr, uint32 hashcode); /* localbuf.c */ -extern BufferDesc *LocalBufferAlloc(Relation reln, BlockNumber blockNum, +extern BufferDesc *LocalBufferAlloc(SMgrRelation reln, BlockNumber blockNum, bool *foundPtr); extern void MarkLocalBufferDirty(Buffer buffer); extern void DropRelFileNodeLocalBuffers(RelFileNode rnode, -- cgit v1.2.3