bufmgr: Add some more error checking [infrastructure] around pinning
authorAndres Freund <andres@anarazel.de>
Wed, 5 Apr 2023 17:42:17 +0000 (10:42 -0700)
committerAndres Freund <andres@anarazel.de>
Wed, 5 Apr 2023 17:42:17 +0000 (10:42 -0700)
commit819b69a81d307e2ad8e9752cf062ebb57813960d
treeeed8d5387f91d975d81577560e914cea80fcc17d
parent4d330a61bb1969df31f2cebfe1ba9d1d004346d8
bufmgr: Add some more error checking [infrastructure] around pinning

This adds a few more assertions against a buffer being local in places we
don't expect, and extracts the check for a buffer being pinned exactly once
from LockBufferForCleanup() into its own function. Later commits will use this
function.

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: http://postgr.es/m/419312fd-9255-078c-c3e3-f0525f911d7f@iki.fi
src/backend/storage/buffer/bufmgr.c
src/include/storage/bufmgr.h