postgresql/src
Peter Geoghegan d088ba5a5a nbtree: Allocate new pages in separate function.
Split nbtree's _bt_getbuf function is two: code that read locks or write
locks existing pages remains in _bt_getbuf, while code that deals with
allocating new pages is moved to a new, dedicated function called
_bt_allocbuf.  This simplifies most _bt_getbuf callers, since it is no
longer necessary for them to pass a heaprel argument.  Many of the
changes to nbtree from commit 61b313e4 can be reverted.  This minimizes
the divergence between HEAD/PostgreSQL 16 and earlier release branches.

_bt_allocbuf replaces the previous nbtree idiom of passing P_NEW to
_bt_getbuf.  There are only 3 affected call sites, all of which continue
to pass a heaprel for recovery conflict purposes.  Note that nbtree's
use of P_NEW was superficial; nbtree never actually relied on the P_NEW
code paths in bufmgr.c, so this change is strictly mechanical.

GiST already took the same approach; it has a dedicated function for
allocating new pages called gistNewBuffer().  That factor allowed commit
61b313e4 to make much more targeted changes to GiST.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/CAH2-Wz=8Z9qY58bjm_7TAHgtW6RzZ5Ke62q5emdCEy9BAzwhmg@mail.gmail.com
2023-06-10 14:08:25 -07:00
..
backend nbtree: Allocate new pages in separate function. 2023-06-10 14:08:25 -07:00
bin Revert "Fix search_path to a safe value during maintenance operations." 2023-06-10 08:11:41 -07:00
common meson: Add dependencies to perl modules to various script invocations 2023-06-09 20:12:16 -07:00
fe_utils Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
include nbtree: Allocate new pages in separate function. 2023-06-10 14:08:25 -07:00
interfaces meson: Add dependencies to perl modules to various script invocations 2023-06-09 20:12:16 -07:00
makefiles Use --strip-unneeded when stripping static libraries with GNU strip. 2023-04-20 18:12:32 -04:00
pl meson: Add dependencies to perl modules to various script invocations 2023-06-09 20:12:16 -07:00
port Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
template Use unnamed POSIX semaphores on Cygwin. 2023-01-06 10:33:28 +13:00
test Revert "Fix search_path to a safe value during maintenance operations." 2023-06-10 08:11:41 -07:00
timezone Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
tools Doc: update src/tools/pginclude/README. 2023-05-23 18:51:43 -04:00
tutorial Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
.gitignore
DEVELOPERS
Makefile Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
Makefile.global.in Fix prove_installcheck when used with PGXS 2023-05-05 07:09:52 +02:00
Makefile.shlib autoconf: Rely on ar supporting index creation 2022-10-07 11:53:39 -07:00
meson.build Integrate pg_bsd_indent into our build/test infrastructure. 2023-02-12 12:22:21 -05:00
nls-global.mk Fix for make unportability 2022-07-13 09:15:01 +02:00