summaryrefslogtreecommitdiff
path: root/src/backend/postmaster
diff options
context:
space:
mode:
authorPeter Eisentraut2024-03-04 11:00:11 +0000
committerPeter Eisentraut2024-03-04 11:02:20 +0000
commitdbbca2cf299b81299112ca6ada671a36235ec008 (patch)
treeaac5368f0983f682c6a31b6bc6140cd89b50fe3c /src/backend/postmaster
parent24eebc65c26cfcc0ea5b8a95b61fa2fda6118e68 (diff)
Remove unused #include's from backend .c files
as determined by include-what-you-use (IWYU) While IWYU also suggests to *add* a bunch of #include's (which is its main purpose), this patch does not do that. In some cases, a more specific #include replaces another less specific one. Some manual adjustments of the automatic result: - IWYU currently doesn't know about includes that provide global variable declarations (like -Wmissing-variable-declarations), so those includes are being kept manually. - All includes for port(ability) headers are being kept for now, to play it safe. - No changes of catalog/pg_foo.h to catalog/pg_foo_d.h, to keep the patch from exploding in size. Note that this patch touches just *.c files, so nothing declared in header files changes in hidden ways. As a small example, in src/backend/access/transam/rmgr.c, some IWYU pragma annotations are added to handle a special case there. Discussion: https://www.postgresql.org/message-id/flat/af837490-6b2f-46df-ba05-37ea6a6653fc%40eisentraut.org
Diffstat (limited to 'src/backend/postmaster')
-rw-r--r--src/backend/postmaster/autovacuum.c1
-rw-r--r--src/backend/postmaster/auxprocess.c7
-rw-r--r--src/backend/postmaster/bgworker.c2
-rw-r--r--src/backend/postmaster/bgwriter.c5
-rw-r--r--src/backend/postmaster/postmaster.c6
-rw-r--r--src/backend/postmaster/startup.c2
-rw-r--r--src/backend/postmaster/syslogger.c1
-rw-r--r--src/backend/postmaster/walsummarizer.c2
8 files changed, 3 insertions, 23 deletions
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index 3ebe8e91a0b..7d7fff6f5d5 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -95,7 +95,6 @@
#include "storage/pmsignal.h"
#include "storage/proc.h"
#include "storage/procsignal.h"
-#include "storage/sinvaladt.h"
#include "storage/smgr.h"
#include "tcop/tcopprot.h"
#include "utils/fmgroids.h"
diff --git a/src/backend/postmaster/auxprocess.c b/src/backend/postmaster/auxprocess.c
index fc13cd76321..2c86abdb719 100644
--- a/src/backend/postmaster/auxprocess.c
+++ b/src/backend/postmaster/auxprocess.c
@@ -15,7 +15,6 @@
#include <unistd.h>
#include <signal.h>
-#include "libpq/pqsignal.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "postmaster/auxprocess.h"
@@ -24,15 +23,11 @@
#include "postmaster/walsummarizer.h"
#include "postmaster/walwriter.h"
#include "replication/walreceiver.h"
-#include "storage/bufmgr.h"
-#include "storage/bufpage.h"
#include "storage/condition_variable.h"
#include "storage/ipc.h"
#include "storage/proc.h"
-#include "tcop/tcopprot.h"
-#include "utils/memutils.h"
+#include "storage/procsignal.h"
#include "utils/ps_status.h"
-#include "utils/rel.h"
static void ShutdownAuxiliaryProcess(int code, Datum arg);
diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c
index d8e89de7494..b73e91f0c86 100644
--- a/src/backend/postmaster/bgworker.c
+++ b/src/backend/postmaster/bgworker.c
@@ -21,11 +21,9 @@
#include "postmaster/postmaster.h"
#include "replication/logicallauncher.h"
#include "replication/logicalworker.h"
-#include "storage/dsm.h"
#include "storage/ipc.h"
#include "storage/latch.h"
#include "storage/lwlock.h"
-#include "storage/pg_shmem.h"
#include "storage/pmsignal.h"
#include "storage/proc.h"
#include "storage/procsignal.h"
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c
index 6364b16261f..da2d95b9261 100644
--- a/src/backend/postmaster/bgwriter.c
+++ b/src/backend/postmaster/bgwriter.c
@@ -32,7 +32,6 @@
#include "postgres.h"
#include "access/xlog.h"
-#include "access/xlog_internal.h"
#include "libpq/pqsignal.h"
#include "miscadmin.h"
#include "pgstat.h"
@@ -42,15 +41,11 @@
#include "storage/bufmgr.h"
#include "storage/condition_variable.h"
#include "storage/fd.h"
-#include "storage/ipc.h"
#include "storage/lwlock.h"
#include "storage/proc.h"
#include "storage/procsignal.h"
-#include "storage/shmem.h"
#include "storage/smgr.h"
-#include "storage/spin.h"
#include "storage/standby.h"
-#include "utils/guc.h"
#include "utils/memutils.h"
#include "utils/resowner.h"
#include "utils/timestamp.h"
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 59318067460..f3c09e8dc0d 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -91,18 +91,15 @@
#include "access/xlog.h"
#include "access/xlogrecovery.h"
-#include "catalog/pg_control.h"
#include "common/file_perm.h"
#include "common/file_utils.h"
#include "common/ip.h"
#include "common/pg_prng.h"
#include "common/string.h"
#include "lib/ilist.h"
-#include "libpq/auth.h"
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
#include "libpq/pqsignal.h"
-#include "nodes/queryjumble.h"
#include "pg_getopt.h"
#include "pgstat.h"
#include "port/pg_bswap.h"
@@ -119,7 +116,6 @@
#include "replication/walsender.h"
#include "storage/fd.h"
#include "storage/ipc.h"
-#include "storage/pg_shmem.h"
#include "storage/pmsignal.h"
#include "storage/proc.h"
#include "tcop/tcopprot.h"
@@ -133,6 +129,8 @@
#include "utils/varlena.h"
#ifdef EXEC_BACKEND
+#include "nodes/queryjumble.h"
+#include "storage/pg_shmem.h"
#include "storage/spin.h"
#endif
diff --git a/src/backend/postmaster/startup.c b/src/backend/postmaster/startup.c
index 44b6c5bb758..8b51e45bad0 100644
--- a/src/backend/postmaster/startup.c
+++ b/src/backend/postmaster/startup.c
@@ -24,10 +24,8 @@
#include "access/xlogutils.h"
#include "libpq/pqsignal.h"
#include "miscadmin.h"
-#include "pgstat.h"
#include "postmaster/startup.h"
#include "storage/ipc.h"
-#include "storage/latch.h"
#include "storage/pmsignal.h"
#include "storage/procsignal.h"
#include "storage/standby.h"
diff --git a/src/backend/postmaster/syslogger.c b/src/backend/postmaster/syslogger.c
index 6db280e483e..c2a6a226e70 100644
--- a/src/backend/postmaster/syslogger.c
+++ b/src/backend/postmaster/syslogger.c
@@ -51,7 +51,6 @@
#include "tcop/tcopprot.h"
#include "utils/guc.h"
#include "utils/ps_status.h"
-#include "utils/timestamp.h"
/*
* We read() into a temp buffer twice as big as a chunk, so that any fragment
diff --git a/src/backend/postmaster/walsummarizer.c b/src/backend/postmaster/walsummarizer.c
index 8636d9424ec..54fab16c378 100644
--- a/src/backend/postmaster/walsummarizer.c
+++ b/src/backend/postmaster/walsummarizer.c
@@ -32,7 +32,6 @@
#include "common/blkreftable.h"
#include "libpq/pqsignal.h"
#include "miscadmin.h"
-#include "postmaster/bgwriter.h"
#include "postmaster/interrupt.h"
#include "postmaster/walsummarizer.h"
#include "replication/walreceiver.h"
@@ -43,7 +42,6 @@
#include "storage/proc.h"
#include "storage/procsignal.h"
#include "storage/shmem.h"
-#include "storage/spin.h"
#include "utils/guc.h"
#include "utils/memutils.h"
#include "utils/wait_event.h"