mirror of
https://github.com/postgres/postgres.git
synced 2026-03-25 11:56:13 -04:00
Don't include storage/lock.h in so many headers
Since storage/locktags.h was added by commit 322bab7974, many headers
can be made leaner by depending on that instead of on storage/lock.h,
which has many other dependencies.
(In fact, some of these changes were possible even before that.)
Author: Álvaro Herrera <alvherre@kurilemu.de>
Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://postgr.es/m/abvrRZo52Yx9ZzWQ@ip-10-97-1-34.eu-west-3.compute.internal
This commit is contained in:
parent
5f2350a043
commit
2102ebb195
34 changed files with 45 additions and 17 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include "funcapi.h"
|
||||
#include "miscadmin.h"
|
||||
#include "storage/bufmgr.h"
|
||||
#include "storage/lwlock.h"
|
||||
#include "storage/procarray.h"
|
||||
#include "storage/read_stream.h"
|
||||
#include "utils/builtins.h"
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "catalog/namespace.h"
|
||||
#include "pgstat.h"
|
||||
#include "storage/lmgr.h"
|
||||
#include "storage/lock.h"
|
||||
#include "utils/inval.h"
|
||||
#include "utils/syscache.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "commands/defrem.h"
|
||||
#include "commands/tablespace.h"
|
||||
#include "nodes/makefuncs.h"
|
||||
#include "storage/lock.h"
|
||||
#include "utils/array.h"
|
||||
#include "utils/attoptcache.h"
|
||||
#include "utils/builtins.h"
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#include "storage/bufmgr.h"
|
||||
#include "storage/bufpage.h"
|
||||
#include "storage/lmgr.h"
|
||||
#include "storage/lock.h"
|
||||
#include "storage/predicate.h"
|
||||
#include "storage/procarray.h"
|
||||
#include "storage/smgr.h"
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
#include "nodes/execnodes.h"
|
||||
#include "pgstat.h"
|
||||
#include "storage/lmgr.h"
|
||||
#include "storage/lock.h"
|
||||
#include "storage/predicate.h"
|
||||
#include "utils/ruleutils.h"
|
||||
#include "utils/snapmgr.h"
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "storage/indexfsm.h"
|
||||
#include "storage/ipc.h"
|
||||
#include "storage/lmgr.h"
|
||||
#include "storage/lwlock.h"
|
||||
#include "storage/read_stream.h"
|
||||
#include "utils/datum.h"
|
||||
#include "utils/fmgrprotos.h"
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include "common/int.h"
|
||||
#include "lib/qunique.h"
|
||||
#include "miscadmin.h"
|
||||
#include "storage/lwlock.h"
|
||||
#include "utils/datum.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/rel.h"
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "storage/lmgr.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/fmgroids.h"
|
||||
#include "utils/hsearch.h"
|
||||
#include "utils/snapmgr.h"
|
||||
#include "utils/syscache.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include "foreign/foreign.h"
|
||||
#include "miscadmin.h"
|
||||
#include "storage/lmgr.h"
|
||||
#include "storage/lock.h"
|
||||
#include "utils/acl.h"
|
||||
#include "utils/array.h"
|
||||
#include "utils/builtins.h"
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include "catalog/pg_proc.h"
|
||||
#include "catalog/pg_type.h"
|
||||
#include "commands/conversioncmds.h"
|
||||
#include "fmgr.h"
|
||||
#include "mb/pg_wchar.h"
|
||||
#include "miscadmin.h"
|
||||
#include "parser/parse_func.h"
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include "commands/discard.h"
|
||||
#include "commands/prepare.h"
|
||||
#include "commands/sequence.h"
|
||||
#include "storage/lock.h"
|
||||
#include "utils/guc.h"
|
||||
#include "utils/portal.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
#include "miscadmin.h"
|
||||
#include "postmaster/bgwriter.h"
|
||||
#include "storage/fd.h"
|
||||
#include "storage/lwlock.h"
|
||||
#include "storage/procsignal.h"
|
||||
#include "storage/standby.h"
|
||||
#include "utils/acl.h"
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@
|
|||
*/
|
||||
#include "postgres.h"
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include "access/sysattr.h"
|
||||
#include "access/table.h"
|
||||
#include "catalog/partition.h"
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "parser/parse_oper.h"
|
||||
#include "parser/parse_type.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/hsearch.h"
|
||||
#include "utils/inval.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/syscache.h"
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
#include "postmaster/interrupt.h"
|
||||
#include "replication/logicalworker.h"
|
||||
#include "replication/worker_internal.h"
|
||||
#include "storage/lwlock.h"
|
||||
#include "utils/acl.h"
|
||||
#include "utils/builtins.h"
|
||||
#include "utils/fmgroids.h"
|
||||
|
|
|
|||
|
|
@ -22,8 +22,9 @@
|
|||
*/
|
||||
#include "postgres.h"
|
||||
|
||||
#include "storage/lmgr.h" /* for GetLockNameFromTagType */
|
||||
#include "storage/lwlock.h" /* for GetLWLockIdentifier */
|
||||
#include "storage/lmgr.h"
|
||||
#include "storage/lwlock.h"
|
||||
#include "storage/shmem.h"
|
||||
#include "storage/spin.h"
|
||||
#include "utils/wait_event.h"
|
||||
|
||||
|
|
|
|||
1
src/backend/utils/cache/relcache.c
vendored
1
src/backend/utils/cache/relcache.c
vendored
|
|
@ -77,6 +77,7 @@
|
|||
#include "rewrite/rowsecurity.h"
|
||||
#include "storage/fd.h"
|
||||
#include "storage/lmgr.h"
|
||||
#include "storage/lock.h"
|
||||
#include "storage/smgr.h"
|
||||
#include "utils/array.h"
|
||||
#include "utils/builtins.h"
|
||||
|
|
|
|||
1
src/backend/utils/cache/syscache.c
vendored
1
src/backend/utils/cache/syscache.c
vendored
|
|
@ -32,6 +32,7 @@
|
|||
#include "lib/qunique.h"
|
||||
#include "miscadmin.h"
|
||||
#include "storage/lmgr.h"
|
||||
#include "storage/lock.h"
|
||||
#include "utils/catcache.h"
|
||||
#include "utils/inval.h"
|
||||
#include "utils/lsyscache.h"
|
||||
|
|
|
|||
1
src/backend/utils/cache/ts_cache.c
vendored
1
src/backend/utils/cache/ts_cache.c
vendored
|
|
@ -44,6 +44,7 @@
|
|||
#include "utils/catcache.h"
|
||||
#include "utils/fmgroids.h"
|
||||
#include "utils/guc_hooks.h"
|
||||
#include "utils/hsearch.h"
|
||||
#include "utils/inval.h"
|
||||
#include "utils/lsyscache.h"
|
||||
#include "utils/memutils.h"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include "access/htup.h"
|
||||
#include "access/tupdesc.h"
|
||||
#include "nodes/pg_list.h"
|
||||
#include "storage/lock.h"
|
||||
|
||||
/* types supported by reloptions */
|
||||
typedef enum relopt_type
|
||||
|
|
|
|||
|
|
@ -17,7 +17,12 @@
|
|||
#include "access/xact.h"
|
||||
#include "access/xlogdefs.h"
|
||||
#include "datatype/timestamp.h"
|
||||
#include "storage/lock.h"
|
||||
|
||||
/*
|
||||
* forward references in this file
|
||||
*/
|
||||
typedef struct PGPROC PGPROC;
|
||||
typedef struct VirtualTransactionId VirtualTransactionId;
|
||||
|
||||
/*
|
||||
* GlobalTransactionData is defined in twophase.c; other places have no
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#define NAMESPACE_H
|
||||
|
||||
#include "nodes/primnodes.h"
|
||||
#include "storage/lock.h"
|
||||
#include "storage/lockdefs.h"
|
||||
#include "storage/procnumber.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#include "catalog/pg_inherits_d.h" /* IWYU pragma: export */
|
||||
|
||||
#include "nodes/pg_list.h"
|
||||
#include "storage/lock.h"
|
||||
#include "storage/lockdefs.h"
|
||||
|
||||
/* ----------------
|
||||
* pg_inherits definition. cpp turns this into
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#ifndef TOASTING_H
|
||||
#define TOASTING_H
|
||||
|
||||
#include "storage/lock.h"
|
||||
#include "storage/lockdefs.h"
|
||||
|
||||
/*
|
||||
* toasting.c prototypes
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include "nodes/parsenodes.h"
|
||||
#include "parser/parse_node.h"
|
||||
#include "storage/lock.h"
|
||||
#include "storage/lockdefs.h"
|
||||
#include "utils/relcache.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#include "catalog/dependency.h"
|
||||
#include "catalog/objectaddress.h"
|
||||
#include "nodes/parsenodes.h"
|
||||
#include "storage/lock.h"
|
||||
#include "storage/lockdefs.h"
|
||||
#include "utils/relcache.h"
|
||||
|
||||
typedef struct AlterTableUtilityContext AlterTableUtilityContext; /* avoid including
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include "catalog/pg_type.h"
|
||||
#include "parser/parse_node.h"
|
||||
#include "storage/buf.h"
|
||||
#include "storage/lock.h"
|
||||
#include "utils/relcache.h"
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
#include "replication/walreceiver.h"
|
||||
#include "storage/buffile.h"
|
||||
#include "storage/fileset.h"
|
||||
#include "storage/lock.h"
|
||||
#include "storage/shm_mq.h"
|
||||
#include "storage/shm_toc.h"
|
||||
#include "storage/spin.h"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include "lib/stringinfo.h"
|
||||
#include "storage/itemptr.h"
|
||||
#include "storage/lock.h"
|
||||
#include "storage/locktag.h"
|
||||
#include "utils/rel.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ extern PGDLLIMPORT bool Debug_deadlocks;
|
|||
* coding errors from trying to use struct assignment with it; instead use
|
||||
* GET_VXID_FROM_PGPROC().
|
||||
*/
|
||||
typedef struct
|
||||
typedef struct VirtualTransactionId
|
||||
{
|
||||
ProcNumber procNumber; /* proc number of the PGPROC */
|
||||
LocalTransactionId localTransactionId; /* lxid from PGPROC */
|
||||
|
|
|
|||
|
|
@ -14,11 +14,16 @@
|
|||
#ifndef PREDICATE_H
|
||||
#define PREDICATE_H
|
||||
|
||||
#include "access/transam.h"
|
||||
#include "storage/itemptr.h"
|
||||
#include "storage/lock.h"
|
||||
#include "utils/relcache.h"
|
||||
#include "utils/snapshot.h"
|
||||
|
||||
/*
|
||||
* forward references in this file
|
||||
*/
|
||||
typedef struct VirtualTransactionId VirtualTransactionId;
|
||||
|
||||
|
||||
/*
|
||||
* GUC variables
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
#ifndef PROCARRAY_H
|
||||
#define PROCARRAY_H
|
||||
|
||||
#include "storage/lock.h"
|
||||
#include "storage/standby.h"
|
||||
#include "utils/relcache.h"
|
||||
#include "utils/snapshot.h"
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
#ifndef SINVALADT_H
|
||||
#define SINVALADT_H
|
||||
|
||||
#include "storage/lock.h"
|
||||
#include "storage/sinval.h"
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -15,10 +15,13 @@
|
|||
#define STANDBY_H
|
||||
|
||||
#include "datatype/timestamp.h"
|
||||
#include "storage/lock.h"
|
||||
#include "storage/locktag.h"
|
||||
#include "storage/relfilelocator.h"
|
||||
#include "storage/standbydefs.h"
|
||||
|
||||
typedef struct PGPROC PGPROC;
|
||||
typedef struct VirtualTransactionId VirtualTransactionId;
|
||||
|
||||
/* User-settable GUC parameters */
|
||||
extern PGDLLIMPORT int max_standby_archive_delay;
|
||||
extern PGDLLIMPORT int max_standby_streaming_delay;
|
||||
|
|
|
|||
Loading…
Reference in a new issue