refactor: Move BackendWritebackContext initialization

BackendWritebackContext is a purely per-process thing, so it feels
wrong to initialize it in the shmem init/attach functions.  Move the
initialization to InitBufferManagerAccess() instead.

Backpatch to version 19, where the new shared memory callbacks system
was introduced.  While this isn't new with that, it made the ShmemInit
functions more closely related to shared memory initialization than
before.

Reviewed-by: Bharath Rupireddy <[email protected]>
Reviewed-by: Ashutosh Bapat <[email protected]>
Discussion: 
https://www.postgresql.org/message-id/[email protected]
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/15a947f30726cadff695b7601329d90b6703e268

Modified Files
--------------
src/backend/storage/buffer/buf_init.c | 15 ---------------
src/backend/storage/buffer/bufmgr.c   |  6 ++++++
src/include/storage/buf_internals.h   |  1 -
3 files changed, 6 insertions(+), 16 deletions(-)

Reply via email to