aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/xlogutils.h
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2008-10-31 15:05:00 +0000
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2008-10-31 15:05:00 +0000
commit19c8dc839b64a43958f08108b85ce8ca98d06a8b (patch)
treebe6bff739a33bd11e4915f47f30038840d397cd5 /src/include/access/xlogutils.h
parent29077051deae30b7704a3e3f2cf7d0a7e3a4130a (diff)
downloadpostgresql-19c8dc839b64a43958f08108b85ce8ca98d06a8b.tar.gz
postgresql-19c8dc839b64a43958f08108b85ce8ca98d06a8b.zip
Unite ReadBufferWithFork, ReadBufferWithStrategy, and ZeroOrReadBuffer
functions into one ReadBufferExtended function, that takes the strategy and mode as argument. There's three modes, RBM_NORMAL which is the default used by plain ReadBuffer(), RBM_ZERO, which replaces ZeroOrReadBuffer, and a new mode RBM_ZERO_ON_ERROR, which allows callers to read corrupt pages without throwing an error. The FSM needs the new mode to recover from corrupt pages, which could happend if we crash after extending an FSM file, and the new page is "torn". Add fork number to some error messages in bufmgr.c, that still lacked it.
Diffstat (limited to 'src/include/access/xlogutils.h')
-rw-r--r--src/include/access/xlogutils.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/include/access/xlogutils.h b/src/include/access/xlogutils.h
index 0c81d42e44d..53ce771f71c 100644
--- a/src/include/access/xlogutils.h
+++ b/src/include/access/xlogutils.h
@@ -6,12 +6,13 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/xlogutils.h,v 1.26 2008/08/11 11:05:11 heikki Exp $
+ * $PostgreSQL: pgsql/src/include/access/xlogutils.h,v 1.27 2008/10/31 15:05:00 heikki Exp $
*/
#ifndef XLOG_UTILS_H
#define XLOG_UTILS_H
#include "storage/buf.h"
+#include "storage/bufmgr.h"
#include "storage/relfilenode.h"
#include "storage/block.h"
#include "utils/relcache.h"
@@ -25,8 +26,8 @@ extern void XLogTruncateRelation(RelFileNode rnode, ForkNumber forkNum,
BlockNumber nblocks);
extern Buffer XLogReadBuffer(RelFileNode rnode, BlockNumber blkno, bool init);
-extern Buffer XLogReadBufferWithFork(RelFileNode rnode, ForkNumber forknum,
- BlockNumber blkno, bool init);
+extern Buffer XLogReadBufferExtended(RelFileNode rnode, ForkNumber forknum,
+ BlockNumber blkno, ReadBufferMode mode);
extern Relation CreateFakeRelcacheEntry(RelFileNode rnode);
extern void FreeFakeRelcacheEntry(Relation fakerel);