From a55c45470fa0e107c9196d5fc1098504a9b9b1f6 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 4 Jun 2020 22:59:39 +0200 Subject: [PATCH] REORG: include: move queue.h to haproxy/queue{,-t}.h Nothing outstanding here. A number of call places were not justified and removed. --- include/haproxy/queue-t.h | 49 ++++++++++++++++++++++++++++++ include/{proto => haproxy}/queue.h | 15 +++++---- include/proto/server.h | 2 -- include/proto/stream.h | 2 +- include/types/queue.h | 49 ------------------------------ include/types/server.h | 1 - include/types/stream.h | 2 +- src/backend.c | 2 +- src/check.c | 2 +- src/haproxy.c | 1 - src/hlua.c | 1 - src/lb_chash.c | 2 +- src/lb_fas.c | 2 +- src/lb_fwlc.c | 2 +- src/lb_fwrr.c | 2 +- src/lb_map.c | 2 +- src/queue.c | 2 +- src/server.c | 2 +- src/stream.c | 2 +- 19 files changed, 68 insertions(+), 74 deletions(-) create mode 100644 include/haproxy/queue-t.h rename include/{proto => haproxy}/queue.h (94%) delete mode 100644 include/types/queue.h diff --git a/include/haproxy/queue-t.h b/include/haproxy/queue-t.h new file mode 100644 index 000000000..41022852b --- /dev/null +++ b/include/haproxy/queue-t.h @@ -0,0 +1,49 @@ +/* + * include/haproxy/queue-t.h + * This file defines variables and structures needed for queues. + * + * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, version 2.1 + * exclusively. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef _HAPROXY_QUEUE_T_H +#define _HAPROXY_QUEUE_T_H + +#include +#include + +struct proxy; +struct server; +struct stream; + +struct pendconn { + int strm_flags; /* stream flags */ + unsigned int queue_idx; /* value of proxy/server queue_idx at time of enqueue */ + struct stream *strm; + struct proxy *px; + struct server *srv; /* the server we are waiting for, may be NULL if don't care */ + struct server *target; /* the server that was assigned, = srv except if srv==NULL */ + struct eb32_node node; +}; + +#endif /* _HAPROXY_QUEUE_T_H */ + +/* + * Local variables: + * c-indent-level: 8 + * c-basic-offset: 8 + * End: + */ diff --git a/include/proto/queue.h b/include/haproxy/queue.h similarity index 94% rename from include/proto/queue.h rename to include/haproxy/queue.h index cd4c5ca55..bded67661 100644 --- a/include/proto/queue.h +++ b/include/haproxy/queue.h @@ -1,8 +1,8 @@ /* - * include/proto/queue.h + * include/haproxy/queue.h * This file defines everything related to queues. * - * Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu + * Copyright (C) 2000-2020 Willy Tarreau - w@1wt.eu * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,17 +19,16 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef _PROTO_QUEUE_H -#define _PROTO_QUEUE_H +#ifndef _HAPROXY_QUEUE_H +#define _HAPROXY_QUEUE_H #include #include #include #include - -#include -#include +#include #include +#include extern struct pool_head *pool_head_pendconn; @@ -105,7 +104,7 @@ static inline int queue_limit_offset(int offset) } -#endif /* _PROTO_QUEUE_H */ +#endif /* _HAPROXY_QUEUE_H */ /* * Local variables: diff --git a/include/proto/server.h b/include/proto/server.h index 383e832c4..066faebce 100644 --- a/include/proto/server.h +++ b/include/proto/server.h @@ -30,10 +30,8 @@ #include #include #include -#include #include -#include #include diff --git a/include/proto/stream.h b/include/proto/stream.h index 59a95f955..be6fcd29b 100644 --- a/include/proto/stream.h +++ b/include/proto/stream.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/types/queue.h b/include/types/queue.h deleted file mode 100644 index d2cb0fffb..000000000 --- a/include/types/queue.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - include/types/queue.h - This file defines variables and structures needed for queues. - - Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1 - exclusively. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _TYPES_QUEUE_H -#define _TYPES_QUEUE_H - -#include -#include - -#include - -struct stream; - -struct pendconn { - int strm_flags; /* stream flags */ - unsigned int queue_idx; /* value of proxy/server queue_idx at time of enqueue */ - struct stream *strm; - struct proxy *px; - struct server *srv; /* the server we are waiting for, may be NULL if don't care */ - struct server *target; /* the server that was assigned, = srv except if srv==NULL */ - struct eb32_node node; -}; - -#endif /* _TYPES_QUEUE_H */ - -/* - * Local variables: - * c-indent-level: 8 - * c-basic-offset: 8 - * End: - */ diff --git a/include/types/server.h b/include/types/server.h index 587b06997..dcf5c40cb 100644 --- a/include/types/server.h +++ b/include/types/server.h @@ -40,7 +40,6 @@ #include #include -#include #include diff --git a/include/types/stream.h b/include/types/stream.h index 8f87ad58d..550a7ea26 100644 --- a/include/types/stream.h +++ b/include/types/stream.h @@ -37,11 +37,11 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/src/backend.c b/src/backend.c index 6e6280ac7..26e36ae41 100644 --- a/src/backend.c +++ b/src/backend.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -52,7 +53,6 @@ #include #include #include -#include #include #include #include diff --git a/src/check.c b/src/check.c index 4e898b036..1adbf56e2 100644 --- a/src/check.c +++ b/src/check.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +60,6 @@ #include #include -#include #include #include #include diff --git a/src/haproxy.c b/src/haproxy.c index d2aebce93..a9e264f37 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -125,7 +125,6 @@ #include #include #include -#include #include #include diff --git a/src/hlua.c b/src/hlua.c index d557777c9..1ab6f5afd 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -54,7 +54,6 @@ #include #include -#include #include #include diff --git a/src/lb_chash.c b/src/lb_chash.c index 508b90c04..aaaef8958 100644 --- a/src/lb_chash.c +++ b/src/lb_chash.c @@ -18,11 +18,11 @@ #include #include +#include #include #include #include -#include /* Return next tree node after which must still be in the tree, or be * NULL. Lookup wraps around the end to the beginning. If the next node is the diff --git a/src/lb_fas.c b/src/lb_fas.c index 896740682..fc9ae5182 100644 --- a/src/lb_fas.c +++ b/src/lb_fas.c @@ -18,10 +18,10 @@ #include #include +#include #include #include -#include /* Remove a server from a tree. It must have previously been dequeued. This diff --git a/src/lb_fwlc.c b/src/lb_fwlc.c index aef9353c8..d7c695317 100644 --- a/src/lb_fwlc.c +++ b/src/lb_fwlc.c @@ -12,10 +12,10 @@ #include #include +#include #include #include -#include /* Remove a server from a tree. It must have previously been dequeued. This diff --git a/src/lb_fwrr.c b/src/lb_fwrr.c index 72029a6a4..145d09784 100644 --- a/src/lb_fwrr.c +++ b/src/lb_fwrr.c @@ -12,10 +12,10 @@ #include #include +#include #include #include -#include static inline void fwrr_remove_from_tree(struct server *s); static inline void fwrr_queue_by_weight(struct eb_root *root, struct server *s); diff --git a/src/lb_map.c b/src/lb_map.c index a6d1cf864..c963180a9 100644 --- a/src/lb_map.c +++ b/src/lb_map.c @@ -13,10 +13,10 @@ #include #include #include +#include #include #include -#include /* this function updates the map according to server 's new state. * diff --git a/src/queue.c b/src/queue.c index 9cdce013a..ea0b64af7 100644 --- a/src/queue.c +++ b/src/queue.c @@ -73,6 +73,7 @@ s * queue's lock. #include #include #include +#include #include #include #include @@ -81,7 +82,6 @@ s * queue's lock. #include #include -#include #include #include diff --git a/src/server.c b/src/server.c index df90b2240..4751065b7 100644 --- a/src/server.c +++ b/src/server.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -36,7 +37,6 @@ #include #include -#include #include #include #include diff --git a/src/stream.c b/src/stream.c index b73060d32..45c1bc845 100644 --- a/src/stream.c +++ b/src/stream.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -55,7 +56,6 @@ #include #include #include -#include #include #include