Another round of code cleanup on bufmgr. Use BM_VALID flag to keep track
Tom Lane <tgl@sss.pgh.pa.us>
Another round of code cleanup on bufmgr. Use BM_VALID flag to keep track of whether we have successfully read data into a buffer; this makes the error behavior a bit more transparent (IMHO anyway), and also makes it work correctly for local buffers which don't use Start/TerminateBufferIO. Collapse three separate functions for writing a shared buffer into one. This overlaps a bit with cleanups that Neil proposed awhile back, but seems not to have committed yet.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/storage/buffer/buf_init.c | modified | +3 −3 |
| src/backend/storage/buffer/bufmgr.c | modified | +273 −385 |
| src/backend/storage/buffer/freelist.c | modified | +11 −9 |
| src/backend/storage/buffer/localbuf.c | modified | +23 −11 |
| src/include/storage/buf_internals.h | modified | +14 −16 |
| src/include/storage/bufmgr.h | modified | +2 −2 |