pgsql: bufmgr: Restructure AsyncReadBuffers()

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: bufmgr: Restructure AsyncReadBuffers()
Date: 2026-03-26 16:32:18
Message-ID: E1w5nd3-001ZE2-2g@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

bufmgr: Restructure AsyncReadBuffers()

Restructure AsyncReadBuffers() to use early return when the head buffer is
already valid, instead of using a did_start_io flag and if/else branches. Also
move around a bit of the code to be located closer to where it is used. This
is a refactor only.

Author: Melanie Plageman <melanieplageman(at)gmail(dot)com>
Reviewed-by: Andres Freund <andres(at)anarazel(dot)de>
Discussion: https://postgr.es/m/zljergweqti7x67lg5ije2rzjusie37nslsnkjkkby4laqqbfw@3p3zu522yykv

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8a1a1d6ab86217020a612ee2e03eae4fe00ae781

Modified Files
--------------
src/backend/storage/buffer/bufmgr.c | 157 +++++++++++++++++++-----------------
1 file changed, 81 insertions(+), 76 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2026-03-26 19:06:40 pgsql: Address perlcritic complaint in response to 906a0469728
Previous Message Robert Haas 2026-03-26 16:06:10 pgsql: pg_plan_advice: Refactor to invent pgpa_planner_info