r5567 - trunk/varnish-cache/bin/varnishd
phk at varnish-cache.org
phk at varnish-cache.org
Sun Nov 21 10:35:39 CET 2010
Author: phk
Date: 2010-11-21 10:35:37 +0100 (Sun, 21 Nov 2010)
New Revision: 5567
Modified:
trunk/varnish-cache/bin/varnishd/cache.h
trunk/varnish-cache/bin/varnishd/cache_dir.c
trunk/varnish-cache/bin/varnishd/cache_dir_dns.c
trunk/varnish-cache/bin/varnishd/cache_dir_random.c
trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c
trunk/varnish-cache/bin/varnishd/cache_hash.c
trunk/varnish-cache/bin/varnishd/cache_vrt_var.c
Log:
Rename and argument switcheroo cleanup
Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h 2010-11-21 09:08:29 UTC (rev 5566)
+++ trunk/varnish-cache/bin/varnishd/cache.h 2010-11-21 09:35:37 UTC (rev 5567)
@@ -526,8 +526,8 @@
void VBE_UseHealth(const struct director *vdi);
struct vbc *VDI_GetFd(const struct director *, struct sess *sp);
-int VDI_Healthy(double now, const struct director *, uintptr_t target);
-int VDI_Healthy_sp(const struct sess *sp, const struct director *);
+int VDI_Healthy_x(double now, const struct director *, uintptr_t target);
+int VDI_Healthy(const struct director *, const struct sess *sp);
void VDI_CloseFd(struct sess *sp);
void VDI_RecycleFd(struct sess *sp);
void VDI_AddHostHeader(const struct sess *sp);
Modified: trunk/varnish-cache/bin/varnishd/cache_dir.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir.c 2010-11-21 09:08:29 UTC (rev 5566)
+++ trunk/varnish-cache/bin/varnishd/cache_dir.c 2010-11-21 09:35:37 UTC (rev 5567)
@@ -111,7 +111,7 @@
*/
int
-VDI_Healthy_sp(const struct sess *sp, const struct director *d)
+VDI_Healthy(const struct director *d, const struct sess *sp)
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
@@ -120,7 +120,7 @@
}
int
-VDI_Healthy(double now, const struct director *d, uintptr_t target)
+VDI_Healthy_x(double now, const struct director *d, uintptr_t target)
{
CHECK_OBJ_NOTNULL(d, DIRECTOR_MAGIC);
Modified: trunk/varnish-cache/bin/varnishd/cache_dir_dns.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_dns.c 2010-11-21 09:08:29 UTC (rev 5566)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_dns.c 2010-11-21 09:35:37 UTC (rev 5567)
@@ -157,7 +157,7 @@
current = i + initial - nhosts;
else
current = i + initial;
- if (VDI_Healthy_sp(sp, group->hosts[current])) {
+ if (VDI_Healthy(group->hosts[current], sp)) {
group->next_host = current+1;
return (group->hosts[current]);
}
@@ -390,7 +390,7 @@
CAST_OBJ_NOTNULL(vs, director->priv, VDI_DNS_MAGIC);
dir = vdi_dns_find_backend(sp, vs);
- if (!dir || !VDI_Healthy_sp(sp, dir))
+ if (!dir || !VDI_Healthy(dir, sp))
return (NULL);
vbe = VDI_GetFd(dir, sp);
Modified: trunk/varnish-cache/bin/varnishd/cache_dir_random.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_random.c 2010-11-21 09:08:29 UTC (rev 5566)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_random.c 2010-11-21 09:35:37 UTC (rev 5567)
@@ -138,7 +138,7 @@
if (r >= s1)
continue;
d2 = vs->hosts[i].backend;
- if (!VDI_Healthy_sp(sp, d2))
+ if (!VDI_Healthy(d2, sp))
break;
vbe = VDI_GetFd(d2, sp);
if (vbe != NULL)
@@ -153,7 +153,7 @@
for (i = 0; i < vs->nhosts; i++) {
d2 = vs->hosts[i].backend;
/* XXX: cache result of healty to avoid double work */
- if (VDI_Healthy_sp(sp, d2))
+ if (VDI_Healthy(d2, sp))
s1 += vs->hosts[i].weight;
}
@@ -172,7 +172,7 @@
s1 = 0.0;
for (i = 0; i < vs->nhosts; i++) {
d2 = vs->hosts[i].backend;
- if (!VDI_Healthy_sp(sp, d2))
+ if (!VDI_Healthy(d2, sp))
continue;
s1 += vs->hosts[i].weight;
if (r >= s1)
@@ -197,7 +197,7 @@
CAST_OBJ_NOTNULL(vs, d->priv, VDI_RANDOM_MAGIC);
for (i = 0; i < vs->nhosts; i++) {
- if (VDI_Healthy(now, vs->hosts[i].backend, target))
+ if (VDI_Healthy_x(now, vs->hosts[i].backend, target))
return 1;
}
return 0;
Modified: trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c 2010-11-21 09:08:29 UTC (rev 5566)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c 2010-11-21 09:35:37 UTC (rev 5567)
@@ -74,7 +74,7 @@
for (i = 0; i < vs->nhosts; i++) {
backend = vs->hosts[vs->next_host].backend;
vs->next_host = (vs->next_host + 1) % vs->nhosts;
- if (!VDI_Healthy_sp(sp, backend))
+ if (!VDI_Healthy(backend, sp))
continue;
vbe = VDI_GetFd(backend, sp);
if (vbe != NULL)
@@ -96,7 +96,7 @@
for (i = 0; i < vs->nhosts; i++) {
backend = vs->hosts[i].backend;
- if (VDI_Healthy(now, backend, target))
+ if (VDI_Healthy_x(now, backend, target))
return 1;
}
return 0;
Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c 2010-11-21 09:08:29 UTC (rev 5566)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2010-11-21 09:35:37 UTC (rev 5567)
@@ -393,7 +393,7 @@
if (oc == NULL /* We found no live object */
&& grace_oc != NULL /* There is a grace candidate */
&& (busy_oc != NULL /* Somebody else is already busy */
- || !VDI_Healthy(sp->t_req, sp->director, (uintptr_t)oh))) {
+ || !VDI_Healthy_x(sp->t_req, sp->director, (uintptr_t)oh))) {
/* Or it is impossible to fetch */
o = oc_getobj(sp->wrk, grace_oc);
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_var.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt_var.c 2010-11-21 09:08:29 UTC (rev 5566)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt_var.c 2010-11-21 09:35:37 UTC (rev 5567)
@@ -559,6 +559,6 @@
{
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->director, DIRECTOR_MAGIC);
- return (VDI_Healthy_sp(sp, sp->director));
+ return (VDI_Healthy(sp->director, sp));
}
More information about the varnish-commit
mailing list