From: Willy Tarreau Date: Thu, 4 Jun 2020 20:50:02 +0000 (+0200) Subject: REORG: include: move backend.h to haproxy/backend{,-t}.h X-Git-Tag: v2.2-dev9~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4980160eccaef7d2671a123f9e5af88d0cfead2c;p=thirdparty%2Fhaproxy.git REORG: include: move backend.h to haproxy/backend{,-t}.h The files remained mostly unchanged since they were OK. However, half of the users didn't need to include them, and about as many actually needed to have it and used to find functions like srv_currently_usable() through a long chain that broke when moving the file. --- diff --git a/contrib/prometheus-exporter/service-prometheus.c b/contrib/prometheus-exporter/service-prometheus.c index 6e9e11631e..c3f9f95254 100644 --- a/contrib/prometheus-exporter/service-prometheus.c +++ b/contrib/prometheus-exporter/service-prometheus.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -26,7 +27,6 @@ #include #include -#include #include #include #include diff --git a/include/types/backend.h b/include/haproxy/backend-t.h similarity index 98% rename from include/types/backend.h rename to include/haproxy/backend-t.h index 120081f7b2..757bb2fc3b 100644 --- a/include/types/backend.h +++ b/include/haproxy/backend-t.h @@ -1,5 +1,5 @@ /* - * include/types/backend.h + * include/haproxy/backend-t.h * This file assembles definitions for backends * * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu @@ -19,17 +19,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _TYPES_BACKEND_H -#define _TYPES_BACKEND_H +#ifndef _HAPROXY_BACKEND_T_H +#define _HAPROXY_BACKEND_T_H #include #include #include #include #include +#include #include -#include - #include /* Parameters for lbprm.algo */ @@ -168,7 +167,7 @@ struct lbprm { void (*server_drop_conn)(struct server *); /* to be called when connection is dropped */ }; -#endif /* _TYPES_BACKEND_H */ +#endif /* _HAPROXY_BACKEND_T_H */ /* * Local variables: diff --git a/include/proto/backend.h b/include/haproxy/backend.h similarity index 96% rename from include/proto/backend.h rename to include/haproxy/backend.h index 57d606e661..6662d59ff1 100644 --- a/include/proto/backend.h +++ b/include/haproxy/backend.h @@ -1,5 +1,5 @@ /* - * include/proto/backend.h + * include/haproxy/backend.h * Functions prototypes for the backend. * * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu @@ -19,14 +19,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _PROTO_BACKEND_H -#define _PROTO_BACKEND_H +#ifndef _HAPROXY_BACKEND_H +#define _HAPROXY_BACKEND_H +#include #include #include #include - -#include #include #include @@ -144,7 +143,7 @@ static inline int srv_lb_status_changed(const struct server *srv) */ void set_backend_down(struct proxy *be); -#endif /* _PROTO_BACKEND_H */ +#endif /* _HAPROXY_BACKEND_H */ /* * Local variables: diff --git a/include/haproxy/proxy-t.h b/include/haproxy/proxy-t.h index d66ab34488..b89fb2192e 100644 --- a/include/haproxy/proxy-t.h +++ b/include/haproxy/proxy-t.h @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -38,7 +39,6 @@ #include #include #include -#include #include /* values for proxy->state */ diff --git a/include/proto/queue.h b/include/proto/queue.h index 735a1f147b..cd4c5ca550 100644 --- a/include/proto/queue.h +++ b/include/proto/queue.h @@ -22,6 +22,7 @@ #ifndef _PROTO_QUEUE_H #define _PROTO_QUEUE_H +#include #include #include #include @@ -30,8 +31,6 @@ #include #include -#include - extern struct pool_head *pool_head_pendconn; struct pendconn *pendconn_add(struct stream *strm); diff --git a/src/backend.c b/src/backend.c index 18a5697634..6e6280ac7e 100644 --- a/src/backend.c +++ b/src/backend.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -49,7 +50,6 @@ #include #include -#include #include #include #include diff --git a/src/cfgparse.c b/src/cfgparse.c index 0be9834ad7..631f10021c 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -72,7 +73,6 @@ #include -#include #include #include #include diff --git a/src/check.c b/src/check.c index d328350948..4e898b036f 100644 --- a/src/check.c +++ b/src/check.c @@ -58,7 +58,6 @@ #include #include -#include #include #include #include diff --git a/src/cli.c b/src/cli.c index dd4ef0d258..321a974e23 100644 --- a/src/cli.c +++ b/src/cli.c @@ -55,7 +55,6 @@ #include #include -#include #include #include #include diff --git a/src/flt_spoe.c b/src/flt_spoe.c index 35a99c6c7c..47a43e69a2 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -37,7 +37,6 @@ #include #include -#include #include #include diff --git a/src/haproxy.c b/src/haproxy.c index b617249a96..d2aebce933 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -123,7 +123,6 @@ #include #include -#include #include #include #include diff --git a/src/http_ana.c b/src/http_ana.c index c420d796ac..c6b292e796 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -12,6 +12,7 @@ #include #include +#include #include #include #include diff --git a/src/lb_chash.c b/src/lb_chash.c index 4cb97ada47..508b90c049 100644 --- a/src/lb_chash.c +++ b/src/lb_chash.c @@ -16,13 +16,12 @@ * */ +#include #include #include #include #include - -#include #include /* Return next tree node after which must still be in the tree, or be diff --git a/src/lb_fas.c b/src/lb_fas.c index ae1297ea11..896740682f 100644 --- a/src/lb_fas.c +++ b/src/lb_fas.c @@ -16,12 +16,11 @@ * */ +#include #include #include #include - -#include #include diff --git a/src/lb_fwlc.c b/src/lb_fwlc.c index 3aa050f4e4..aef9353c82 100644 --- a/src/lb_fwlc.c +++ b/src/lb_fwlc.c @@ -10,12 +10,11 @@ * */ +#include #include #include #include - -#include #include diff --git a/src/lb_fwrr.c b/src/lb_fwrr.c index 7eafe489a7..72029a6a46 100644 --- a/src/lb_fwrr.c +++ b/src/lb_fwrr.c @@ -10,12 +10,11 @@ * */ +#include #include #include #include - -#include #include static inline void fwrr_remove_from_tree(struct server *s); diff --git a/src/lb_map.c b/src/lb_map.c index 2b00fdb59d..a6d1cf8641 100644 --- a/src/lb_map.c +++ b/src/lb_map.c @@ -10,13 +10,12 @@ * */ +#include #include #include #include #include - -#include #include /* this function updates the map according to server 's new state. diff --git a/src/proxy.c b/src/proxy.c index 1ca6ab276a..173f17dff1 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -41,7 +41,6 @@ #include -#include #include #include #include diff --git a/src/queue.c b/src/queue.c index 6e99769664..9cdce013a0 100644 --- a/src/queue.c +++ b/src/queue.c @@ -44,7 +44,7 @@ * - a pendconn_add() is only performed by the stream which will own the * pendconn ; the pendconn is allocated at this moment and returned ; it is * added to either the server or the proxy's queue while holding this - * queue's lock. +s * queue's lock. * * - the pendconn is then met by a thread walking over the proxy or server's * queue with the respective lock held. This lock is exclusive and the @@ -69,6 +69,7 @@ * - a pendconn doesn't switch between queues, it stays where it is. */ +#include #include #include #include diff --git a/src/server.c b/src/server.c index 7ac890513f..df90b22401 100644 --- a/src/server.c +++ b/src/server.c @@ -15,6 +15,7 @@ #include #include +#include #include #include diff --git a/src/stats.c b/src/stats.c index 477b0ab87c..4f6f6c009d 100644 --- a/src/stats.c +++ b/src/stats.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -57,7 +58,6 @@ #include #include -#include #include #include #include diff --git a/src/stream.c b/src/stream.c index 4bf1bdc7d1..b73060d32d 100644 --- a/src/stream.c +++ b/src/stream.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -50,7 +51,6 @@ #include #include -#include #include #include #include