Unite ReadBufferWithFork, ReadBufferWithStrategy, and ZeroOrReadBuffer
commita8f33f8c559265643a5a80987ed0b1d213c3a15c
authorheikki <heikki>
Fri, 31 Oct 2008 15:05:00 +0000 (31 15:05 +0000)
committerheikki <heikki>
Fri, 31 Oct 2008 15:05:00 +0000 (31 15:05 +0000)
treebf02e1018bd96523669bbbfd58aedf821e08c372
parent6fbd916a41fe79197ce3eff694dba6148f7d44f1
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.
15 files changed:
contrib/pageinspect/rawpage.c
src/backend/access/gin/ginvacuum.c
src/backend/access/gist/gistvacuum.c
src/backend/access/hash/hashpage.c
src/backend/access/heap/heapam.c
src/backend/access/nbtree/nbtree.c
src/backend/access/transam/xlog.c
src/backend/access/transam/xlogutils.c
src/backend/commands/analyze.c
src/backend/commands/vacuum.c
src/backend/commands/vacuumlazy.c
src/backend/storage/buffer/bufmgr.c
src/backend/storage/freespace/freespace.c
src/include/access/xlogutils.h
src/include/storage/bufmgr.h