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.
This commit is contained in:
Willy Tarreau 2020-06-04 22:50:02 +02:00
parent 6c58ab0304
commit 4980160ecc
22 changed files with 26 additions and 36 deletions

View File

@ -15,6 +15,7 @@
#include <haproxy/action-t.h> #include <haproxy/action-t.h>
#include <haproxy/applet.h> #include <haproxy/applet.h>
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <common/cfgparse.h> #include <common/cfgparse.h>
#include <haproxy/frontend.h> #include <haproxy/frontend.h>
@ -26,7 +27,6 @@
#include <haproxy/pool.h> #include <haproxy/pool.h>
#include <haproxy/list.h> #include <haproxy/list.h>
#include <proto/backend.h>
#include <haproxy/compression.h> #include <haproxy/compression.h>
#include <haproxy/pipe.h> #include <haproxy/pipe.h>
#include <haproxy/proxy.h> #include <haproxy/proxy.h>

View File

@ -1,5 +1,5 @@
/* /*
* include/types/backend.h * include/haproxy/backend-t.h
* This file assembles definitions for backends * This file assembles definitions for backends
* *
* Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu * 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 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef _TYPES_BACKEND_H #ifndef _HAPROXY_BACKEND_T_H
#define _TYPES_BACKEND_H #define _HAPROXY_BACKEND_T_H
#include <haproxy/lb_chash-t.h> #include <haproxy/lb_chash-t.h>
#include <haproxy/lb_fas-t.h> #include <haproxy/lb_fas-t.h>
#include <haproxy/lb_fwlc-t.h> #include <haproxy/lb_fwlc-t.h>
#include <haproxy/lb_fwrr-t.h> #include <haproxy/lb_fwrr-t.h>
#include <haproxy/lb_map-t.h> #include <haproxy/lb_map-t.h>
#include <haproxy/thread-t.h>
#include <haproxy/api-t.h> #include <haproxy/api-t.h>
#include <haproxy/thread.h>
#include <types/server.h> #include <types/server.h>
/* Parameters for lbprm.algo */ /* Parameters for lbprm.algo */
@ -168,7 +167,7 @@ struct lbprm {
void (*server_drop_conn)(struct server *); /* to be called when connection is dropped */ void (*server_drop_conn)(struct server *); /* to be called when connection is dropped */
}; };
#endif /* _TYPES_BACKEND_H */ #endif /* _HAPROXY_BACKEND_T_H */
/* /*
* Local variables: * Local variables:

View File

@ -1,5 +1,5 @@
/* /*
* include/proto/backend.h * include/haproxy/backend.h
* Functions prototypes for the backend. * Functions prototypes for the backend.
* *
* Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu * 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 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef _PROTO_BACKEND_H #ifndef _HAPROXY_BACKEND_H
#define _PROTO_BACKEND_H #define _HAPROXY_BACKEND_H
#include <haproxy/backend-t.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <haproxy/proxy-t.h> #include <haproxy/proxy-t.h>
#include <haproxy/time.h> #include <haproxy/time.h>
#include <types/backend.h>
#include <types/server.h> #include <types/server.h>
#include <types/stream.h> #include <types/stream.h>
@ -144,7 +143,7 @@ static inline int srv_lb_status_changed(const struct server *srv)
*/ */
void set_backend_down(struct proxy *be); void set_backend_down(struct proxy *be);
#endif /* _PROTO_BACKEND_H */ #endif /* _HAPROXY_BACKEND_H */
/* /*
* Local variables: * Local variables:

View File

@ -31,6 +31,7 @@
#include <import/ebpttree.h> #include <import/ebpttree.h>
#include <haproxy/arg-t.h> #include <haproxy/arg-t.h>
#include <haproxy/backend-t.h>
#include <haproxy/check-t.h> #include <haproxy/check-t.h>
#include <haproxy/counters-t.h> #include <haproxy/counters-t.h>
#include <haproxy/freq_ctr-t.h> #include <haproxy/freq_ctr-t.h>
@ -38,7 +39,6 @@
#include <haproxy/obj_type-t.h> #include <haproxy/obj_type-t.h>
#include <haproxy/thread-t.h> #include <haproxy/thread-t.h>
#include <haproxy/api-t.h> #include <haproxy/api-t.h>
#include <types/backend.h>
#include <types/server.h> #include <types/server.h>
/* values for proxy->state */ /* values for proxy->state */

View File

@ -22,6 +22,7 @@
#ifndef _PROTO_QUEUE_H #ifndef _PROTO_QUEUE_H
#define _PROTO_QUEUE_H #define _PROTO_QUEUE_H
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <haproxy/pool.h> #include <haproxy/pool.h>
#include <haproxy/proxy-t.h> #include <haproxy/proxy-t.h>
@ -30,8 +31,6 @@
#include <types/stream.h> #include <types/stream.h>
#include <types/server.h> #include <types/server.h>
#include <proto/backend.h>
extern struct pool_head *pool_head_pendconn; extern struct pool_head *pool_head_pendconn;
struct pendconn *pendconn_add(struct stream *strm); struct pendconn *pendconn_add(struct stream *strm);

View File

@ -20,6 +20,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <haproxy/acl.h> #include <haproxy/acl.h>
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <haproxy/channel.h> #include <haproxy/channel.h>
#include <haproxy/check.h> #include <haproxy/check.h>
@ -49,7 +50,6 @@
#include <haproxy/global.h> #include <haproxy/global.h>
#include <haproxy/arg.h> #include <haproxy/arg.h>
#include <proto/backend.h>
#include <haproxy/protocol.h> #include <haproxy/protocol.h>
#include <haproxy/proto_tcp.h> #include <haproxy/proto_tcp.h>
#include <proto/queue.h> #include <proto/queue.h>

View File

@ -36,6 +36,7 @@
#include <haproxy/acl.h> #include <haproxy/acl.h>
#include <haproxy/action-t.h> #include <haproxy/action-t.h>
#include <haproxy/auth.h> #include <haproxy/auth.h>
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <haproxy/capture.h> #include <haproxy/capture.h>
#include <common/cfgparse.h> #include <common/cfgparse.h>
@ -72,7 +73,6 @@
#include <haproxy/global.h> #include <haproxy/global.h>
#include <proto/backend.h>
#include <haproxy/protocol.h> #include <haproxy/protocol.h>
#include <haproxy/peers.h> #include <haproxy/peers.h>
#include <haproxy/sample.h> #include <haproxy/sample.h>

View File

@ -58,7 +58,6 @@
#include <haproxy/global.h> #include <haproxy/global.h>
#include <haproxy/arg.h> #include <haproxy/arg.h>
#include <proto/backend.h>
#include <haproxy/fd.h> #include <haproxy/fd.h>
#include <proto/queue.h> #include <proto/queue.h>
#include <haproxy/port_range.h> #include <haproxy/port_range.h>

View File

@ -55,7 +55,6 @@
#include <haproxy/global.h> #include <haproxy/global.h>
#include <haproxy/activity.h> #include <haproxy/activity.h>
#include <proto/backend.h>
#include <haproxy/compression.h> #include <haproxy/compression.h>
#include <haproxy/fd.h> #include <haproxy/fd.h>
#include <haproxy/freq_ctr.h> #include <haproxy/freq_ctr.h>

View File

@ -37,7 +37,6 @@
#include <haproxy/global.h> #include <haproxy/global.h>
#include <haproxy/arg.h> #include <haproxy/arg.h>
#include <proto/backend.h>
#include <haproxy/freq_ctr.h> #include <haproxy/freq_ctr.h>
#include <proto/stream.h> #include <proto/stream.h>

View File

@ -123,7 +123,6 @@
#include <haproxy/activity.h> #include <haproxy/activity.h>
#include <haproxy/arg.h> #include <haproxy/arg.h>
#include <proto/backend.h>
#include <haproxy/fd.h> #include <haproxy/fd.h>
#include <haproxy/protocol.h> #include <haproxy/protocol.h>
#include <proto/queue.h> #include <proto/queue.h>

View File

@ -12,6 +12,7 @@
#include <haproxy/acl.h> #include <haproxy/acl.h>
#include <haproxy/action-t.h> #include <haproxy/action-t.h>
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <haproxy/base64.h> #include <haproxy/base64.h>
#include <haproxy/channel.h> #include <haproxy/channel.h>

View File

@ -16,13 +16,12 @@
* *
*/ */
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <haproxy/tools.h> #include <haproxy/tools.h>
#include <import/eb32tree.h> #include <import/eb32tree.h>
#include <types/server.h> #include <types/server.h>
#include <proto/backend.h>
#include <proto/queue.h> #include <proto/queue.h>
/* Return next tree node after <node> which must still be in the tree, or be /* Return next tree node after <node> which must still be in the tree, or be

View File

@ -16,12 +16,11 @@
* *
*/ */
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <import/eb32tree.h> #include <import/eb32tree.h>
#include <types/server.h> #include <types/server.h>
#include <proto/backend.h>
#include <proto/queue.h> #include <proto/queue.h>

View File

@ -10,12 +10,11 @@
* *
*/ */
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <import/eb32tree.h> #include <import/eb32tree.h>
#include <types/server.h> #include <types/server.h>
#include <proto/backend.h>
#include <proto/queue.h> #include <proto/queue.h>

View File

@ -10,12 +10,11 @@
* *
*/ */
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <import/eb32tree.h> #include <import/eb32tree.h>
#include <types/server.h> #include <types/server.h>
#include <proto/backend.h>
#include <proto/queue.h> #include <proto/queue.h>
static inline void fwrr_remove_from_tree(struct server *s); static inline void fwrr_remove_from_tree(struct server *s);

View File

@ -10,13 +10,12 @@
* *
*/ */
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <haproxy/lb_map.h> #include <haproxy/lb_map.h>
#include <import/eb32tree.h> #include <import/eb32tree.h>
#include <types/server.h> #include <types/server.h>
#include <proto/backend.h>
#include <proto/queue.h> #include <proto/queue.h>
/* this function updates the map according to server <srv>'s new state. /* this function updates the map according to server <srv>'s new state.

View File

@ -41,7 +41,6 @@
#include <haproxy/capture-t.h> #include <haproxy/capture-t.h>
#include <proto/backend.h>
#include <haproxy/fd.h> #include <haproxy/fd.h>
#include <haproxy/proto_tcp.h> #include <haproxy/proto_tcp.h>
#include <proto/server.h> #include <proto/server.h>

View File

@ -44,7 +44,7 @@
* - a pendconn_add() is only performed by the stream which will own the * - 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 * 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 * 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 * - 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 * 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. * - a pendconn doesn't switch between queues, it stays where it is.
*/ */
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <haproxy/http_rules.h> #include <haproxy/http_rules.h>
#include <haproxy/pool.h> #include <haproxy/pool.h>

View File

@ -15,6 +15,7 @@
#include <errno.h> #include <errno.h>
#include <haproxy/applet-t.h> #include <haproxy/applet-t.h>
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <import/xxhash.h> #include <import/xxhash.h>

View File

@ -25,6 +25,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <haproxy/applet-t.h> #include <haproxy/applet-t.h>
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <common/cfgparse.h> #include <common/cfgparse.h>
#include <haproxy/channel.h> #include <haproxy/channel.h>
@ -57,7 +58,6 @@
#include <haproxy/version.h> #include <haproxy/version.h>
#include <haproxy/base64.h> #include <haproxy/base64.h>
#include <proto/backend.h>
#include <haproxy/fd.h> #include <haproxy/fd.h>
#include <haproxy/freq_ctr.h> #include <haproxy/freq_ctr.h>
#include <haproxy/pipe.h> #include <haproxy/pipe.h>

View File

@ -19,6 +19,7 @@
#include <haproxy/acl.h> #include <haproxy/acl.h>
#include <haproxy/action.h> #include <haproxy/action.h>
#include <haproxy/applet.h> #include <haproxy/applet.h>
#include <haproxy/backend.h>
#include <haproxy/api.h> #include <haproxy/api.h>
#include <haproxy/capture.h> #include <haproxy/capture.h>
#include <common/cfgparse.h> #include <common/cfgparse.h>
@ -50,7 +51,6 @@
#include <haproxy/activity.h> #include <haproxy/activity.h>
#include <haproxy/arg.h> #include <haproxy/arg.h>
#include <proto/backend.h>
#include <haproxy/fd.h> #include <haproxy/fd.h>
#include <haproxy/freq_ctr.h> #include <haproxy/freq_ctr.h>
#include <proto/stream.h> #include <proto/stream.h>