bufmgr: Introduce FlushUnlockedBuffer
authorAndres Freund <andres@anarazel.de>
Wed, 8 Oct 2025 18:34:30 +0000 (14:34 -0400)
committerAndres Freund <andres@anarazel.de>
Wed, 8 Oct 2025 18:34:30 +0000 (14:34 -0400)
commit3c2b97b29ee33d5619779fd10e06eee07d4700da
treec2cc427ff7fa3b66593c27bf9d96bb3e4503cf62
parent819dc118c0f6cd1fc08f0e807702b4bc0b0d8733
bufmgr: Introduce FlushUnlockedBuffer

There were several copies of code locking a buffer, flushing its contents, and
unlocking the buffer. It seems worth centralizing that into a helper function.

Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com>
Discussion: https://postgr.es/m/fvfmkr5kk4nyex56ejgxj3uzi63isfxovp2biecb4bspbjrze7@az2pljabhnff
src/backend/storage/buffer/bufmgr.c