Commit eafcc6fb authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Rename backend_is_healthy() to VBE_Healthy() for naming-space consistency.



git-svn-id: http://www.varnish-cache.org/svn/trunk@4389 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 27399694
......@@ -229,7 +229,7 @@ VBE_GetFd(struct sess *sp)
sp->vbe = sp->director->getfd(sp);
}
/*
/*--------------------------------------------------------------------
* It evaluates if a backend is healthy _for_a_specific_object_.
* That means that it relies on sp->objhead. This is mainly for saint-mode,
* but also takes backend->healthy into account. If
......@@ -239,8 +239,9 @@ VBE_GetFd(struct sess *sp)
* The threshold has to be evaluated _after_ the timeout check, otherwise
* items would never time out once the threshold is reached.
*/
unsigned int
backend_is_healthy(const struct sess *sp, struct backend *backend)
VBE_Healthy(const struct sess *sp, struct backend *backend)
{
struct trouble *tr;
struct trouble *tr2;
......@@ -339,7 +340,7 @@ VBE_GetVbe(struct sess *sp, struct backend *bp)
VBE_ClosedFd(sp);
}
if (!backend_is_healthy(sp, bp)) {
if (!VBE_Healthy(sp, bp)) {
VSL_stats->backend_unhealthy++;
return (NULL);
}
......
......@@ -143,7 +143,7 @@ struct backend {
/* cache_backend.c */
void VBE_ReleaseConn(struct vbe_conn *vc);
struct vbe_conn *VBE_GetVbe(struct sess *sp, struct backend *bp);
unsigned int backend_is_healthy(const struct sess *sp, struct backend *backend);
unsigned int VBE_Healthy(const struct sess *sp, struct backend *backend);
/* cache_backend_cfg.c */
extern struct lock VBE_mtx;
......
......@@ -81,7 +81,7 @@ vdi_random_getfd(struct sess *sp)
/* Sum up the weights of healty backends */
s1 = 0.0;
for (i = 0; i < vs->nhosts; i++)
if (backend_is_healthy(sp,vs->hosts[i].backend))
if (VBE_Healthy(sp,vs->hosts[i].backend))
s1 += vs->hosts[i].weight;
if (s1 == 0.0)
......@@ -94,7 +94,7 @@ vdi_random_getfd(struct sess *sp)
s1 = 0.0;
for (i = 0; i < vs->nhosts; i++) {
if (!backend_is_healthy(sp, vs->hosts[i].backend))
if (!VBE_Healthy(sp, vs->hosts[i].backend))
continue;
s1 += vs->hosts[i].weight;
if (r >= s1)
......@@ -120,7 +120,7 @@ vdi_random_healthy(const struct sess *sp)
CAST_OBJ_NOTNULL(vs, sp->director->priv, VDI_RANDOM_MAGIC);
for (i = 0; i < vs->nhosts; i++) {
if (backend_is_healthy(sp,vs->hosts[i].backend))
if (VBE_Healthy(sp,vs->hosts[i].backend))
return 1;
}
return 0;
......
......@@ -75,7 +75,7 @@ vdi_round_robin_getfd(struct sess *sp)
for (i = 0; i < vs->nhosts; i++) {
backend = vs->hosts[vs->next_host].backend;
vs->next_host = (vs->next_host + 1) % vs->nhosts;
if (!backend_is_healthy(sp, backend))
if (!VBE_Healthy(sp, backend))
continue;
vbe = VBE_GetVbe(sp, backend);
if (vbe != NULL)
......@@ -96,7 +96,7 @@ vdi_round_robin_healthy(const struct sess *sp)
CAST_OBJ_NOTNULL(vs, sp->director->priv, VDI_ROUND_ROBIN_MAGIC);
for (i = 0; i < vs->nhosts; i++) {
if (backend_is_healthy(sp, vs->hosts[i].backend))
if (VBE_Healthy(sp, vs->hosts[i].backend))
return 1;
}
return 0;
......
......@@ -75,7 +75,7 @@ vdi_simple_healthy(const struct sess *sp)
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->director, DIRECTOR_MAGIC);
CAST_OBJ_NOTNULL(vs, sp->director->priv, VDI_SIMPLE_MAGIC);
return (backend_is_healthy(sp, vs->backend));
return (VBE_Healthy(sp, vs->backend));
}
/*lint -e{818} not const-able */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment