bufmgr: Make buffer hit helper

Andres Freund <andres@anarazel.de>

Commit: df09452c3209d542a19b9c4afa7a18c656cb4a80
Author: Andres Freund <andres@anarazel.de>
Date: 2026-03-26T16:07:05Z
bufmgr: Make buffer hit helper

Already two places count buffer hits, requiring quite a few lines of
code since we do accounting in so many places. Future commits will add
more locations, so refactor into a helper.

Author: Melanie Plageman <melanieplageman@gmail.com>
Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Discussion: https://postgr.es/m/zljergweqti7x67lg5ije2rzjusie37nslsnkjkkby4laqqbfw@3p3zu522yykv

Files

PathChange+/−
src/backend/storage/buffer/bufmgr.c modified +42 −42

Discussion