I posted some bufmgr cleanup a few weeks ago, but it conflicted with
Neil Conway <neilc@samurai.com>
I posted some bufmgr cleanup a few weeks ago, but it conflicted with
some concurrent changes Jan was making to the bufmgr. Here's an
updated version of the patch -- it should apply cleanly to CVS
HEAD and passes the regression tests.
This patch makes the following changes:
- remove the UnlockAndReleaseBuffer() and UnlockAndWriteBuffer()
macros, and replace uses of them with calls to the appropriate
functions.
- remove a bunch of #ifdef BMTRACE code: it is ugly & broken
(i.e. it doesn't compile)
- make BufferReplace() return a bool, not an int
- cleanup some logic in bufmgr.c; should be functionality
equivalent to the previous code, just cleaner now
- remove the BM_PRIVATE flag as it is unused
- improve a few comments, etc.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/heapam.c | modified | +23 −12 |
| src/backend/access/nbtree/nbtxlog.c | modified | +53 −21 |
| src/backend/access/transam/xlog.c | modified | +3 −2 |
| src/backend/access/transam/xlogutils.c | modified | +19 −10 |
| src/backend/commands/sequence.c | modified | +3 −2 |
| src/backend/storage/buffer/buf_init.c | modified | +1 −26 |
| src/backend/storage/buffer/bufmgr.c | modified | +21 −187 |
| src/backend/storage/buffer/buf_table.c | modified | +1 −13 |
| src/include/storage/buf_internals.h | modified | +8 −35 |
| src/include/storage/bufmgr.h | modified | +1 −14 |