]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: mworker: move proc_self from global to mworker
authorWilly Tarreau <w@1wt.eu>
Sat, 8 May 2021 10:30:50 +0000 (12:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 8 May 2021 10:34:44 +0000 (12:34 +0200)
Only mworker uses proc_self, and it was declared in global.h, forcing
users of global.h to include mworker and its dependencies.

Moving it to mworker reduces the preprocessed size of version.c from
170 to 125kB by shrinking the number of local includes from 30 to 16
and the number of system includes from 147 to 132.

include/haproxy/cli.h
include/haproxy/global.h
include/haproxy/mworker.h
src/haproxy.c
src/mworker.c

index 0a4433b692e826dc739be0664dc75ce011702f2b..31020430ef35927e8281599dc55bb89e094981c7 100644 (file)
@@ -27,6 +27,7 @@
 #include <haproxy/channel-t.h>
 #include <haproxy/cli-t.h>
 #include <haproxy/global.h>
+#include <haproxy/mworker-t.h>
 #include <haproxy/stream-t.h>
 
 
index 547a2b8cee66208a95a51dece95489b126c65bcc..a095a5268bbe2d6b448eedef40a60c397c6127ff 100644 (file)
@@ -24,7 +24,6 @@
 
 #include <haproxy/api-t.h>
 #include <haproxy/global-t.h>
-#include <haproxy/mworker-t.h>
 
 extern const char *build_features;
 extern struct global global;
@@ -49,7 +48,6 @@ extern char *localpeer;
 extern unsigned int warned;     /* bitfield of a few warnings to emit just once */
 extern volatile unsigned long sleeping_thread_mask;
 extern struct list proc_list; /* list of process in mworker mode */
-extern struct mworker_proc *proc_self; /* process structure of current process */
 extern int master; /* 1 if in master, 0 otherwise */
 extern unsigned int rlim_fd_cur_at_boot;
 extern unsigned int rlim_fd_max_at_boot;
index edc612ec307751da1a0622c3a69018f66b8e0fe8..434077c0c0670581a93d3699810d9a3292638733 100644 (file)
@@ -17,6 +17,8 @@
 #include <haproxy/mworker-t.h>
 #include <haproxy/signal-t.h>
 
+extern struct mworker_proc *proc_self;
+
 void mworker_proc_list_to_env();
 void mworker_env_to_proc_list();
 
index 3de53bfceb114ed5e67d794da69e53b501964e2d..41715c10507f8d088be1ac1316800733f6dcc4a9 100644 (file)
@@ -252,8 +252,6 @@ unsigned int rlim_fd_max_at_boot = 0;
 /* per-boot randomness */
 unsigned char boot_seed[20];        /* per-boot random seed (160 bits initially) */
 
-struct mworker_proc *proc_self = NULL;
-
 static void *run_thread_poll_loop(void *data);
 
 /* bitfield of a few warnings to emit just once (WARN_*) */
index e3c579b5719c324b320d70b60dac4970c1041634..b69c1adcb243c261e06c95e04508bb54a15a7130 100644 (file)
@@ -42,6 +42,7 @@
 
 static int exitcode = -1;
 static int max_reloads = -1; /* number max of reloads a worker can have until they are killed */
+struct mworker_proc *proc_self = NULL; /* process structure of current process */
 
 /* ----- children processes handling ----- */