On Mon, Nov 18, 2013 at 07:36:58AM +0100, Willy Tarreau wrote:
> On Mon, Nov 18, 2013 at 03:22:33PM +0900, Simon Horman wrote:
> > On Mon, Nov 18, 2013 at 06:45:41AM +0100, Willy Tarreau wrote:
> > > Hi Simon,
> > >
> > > On Tue, Nov 05, 2013 at 06:04:31PM +0900, Simon Horman wrote:
> > > > Hi,
> > > >
> > > > This series is a revised subset of
> > > > "[PATCH v6 00/22] Agent Check Enhancements and External Check".
> > > > I have broken it out as a smaller set of patches to allow
> > > > review to be done in smaller chunks.
> > > >
> > > > Although these patches aren't particularly useful in their own right
> > > > they also should not break anything and were positively reviewed
> > > > when last posted.
> > >
> > > Just finished reviewing them, these patches look OK to me. Do you
> > > want me to merge them now ?
> >
> > Yes, please merge them.
>
> OK, but I just tried and they fail. I think they rely n the first
> series which creates the server's check element and move *inter
> there (3/22 and 4/22 in v6). Presumably you have them in your tree :-)
>
> They were OK so feel free to send me what is needed before these ones
> and I'll merge them at the same time.
Hi,
I'm a little unclear on the way in which the series failed.
But perhaps the problem can be resolved by applying the following
before the series:
"CLEANUP: Make parameters of srv_downtime and srv_getinter const"
Sorry for indicating that patch is a dependency of the series.
I have provided it below for reference.
>
> I currently have this :
>
> [PATCH v7 1/5] MEDIUM: Move result element to struct check
> [PATCH v7 2/5] MEDIUM: Paramatise functions over the check of a server
> [PATCH v7 3/5] MEDIUM: cfgparse: Factor out check initialisation
> [PATCH v7 4/5] MEDIUM: Add state to struct check
> [PATCH v7 5/5] MEDIUM: Move health element to struct check
>
> And previous series started like this :
>
> [PATCH v6 01/22] DOC: Clarify documentation of option lb-agent-chk
> [PATCH v6 02/22] CLEANUP: Make parameters of srv_downtime and srv_getinter
> const
> [PATCH v6 03/22] MEDIUM: Split up struct server's check element
> [PATCH v6 04/22] MEDIUM: Move {,fast,down}inter to struct check
> [PATCH v6 05/22] MEDIUM: Move result element to struct check
> [PATCH v6 06/22] MEDIUM: Paramatise functions over the check of a server
> [PATCH v6 07/22] MEDIUM: cfgparse: Factor out check initialisation
> [PATCH v6 08/22] MEDIUM: Add state to struct check
> [PATCH v6 09/22] MEDIUM: Add name element to struct check
> [PATCH v6 10/22] MEDIUM: Move health element to struct check
>
> Thanks,
> Willy
From: Simon Horman <[email protected]>
[PATCH] CLEANUP: Make parameters of srv_downtime and srv_getinter const
The parameters of srv_downtime and srv_getinter are not modified
and thus may be const.
Signed-off-by: Simon Horman <[email protected]>
---
v7
* No change
Notes by Willy on v6: OK
---
include/proto/server.h | 4 ++--
src/server.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/proto/server.h b/include/proto/server.h
index ded640a..b2df045 100644
--- a/include/proto/server.h
+++ b/include/proto/server.h
@@ -32,8 +32,8 @@
#include <proto/queue.h>
#include <proto/freq_ctr.h>
-int srv_downtime(struct server *s);
-int srv_getinter(struct server *s);
+int srv_downtime(const struct server *s);
+int srv_getinter(const struct server *s);
/* increase the number of cumulated connections on the designated server */
static void inline srv_inc_sess_ctr(struct server *s)
diff --git a/src/server.c b/src/server.c
index 98a9fbe..e542bb7 100644
--- a/src/server.c
+++ b/src/server.c
@@ -22,7 +22,7 @@ static struct srv_kw_list srv_keywords = {
.list = LIST_HEAD_INIT(srv_keywords.list)
};
-int srv_downtime(struct server *s)
+int srv_downtime(const struct server *s)
{
if ((s->state & SRV_RUNNING) && s->last_change < now.tv_sec)
// ignore negative time
return s->down_time;
@@ -30,7 +30,7 @@ int srv_downtime(struct server *s)
return now.tv_sec - s->last_change + s->down_time;
}
-int srv_getinter(struct server *s)
+int srv_getinter(const struct server *s)
{
if ((s->state & SRV_CHECKED) && (s->health == s->rise + s->fall - 1))
return s->inter;
--
1.8.4