[master] 1520837 Systematic rename to make things consistent
Poul-Henning Kamp
phk at FreeBSD.org
Thu Jan 15 11:35:15 CET 2015
commit 1520837fde2789d7c0cdd1067d46f52a4e2a24a1
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Jan 15 10:35:00 2015 +0000
Systematic rename to make things consistent
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 2099c21..85a0c45 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -539,7 +539,7 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
VSB_printf(pan_vsp, "version = %s\n", VCS_version);
VSB_printf(pan_vsp, "ident = %s,%s\n",
- VSB_data(vident) + 1, WAIT_GetName());
+ VSB_data(vident) + 1, Wait_GetName());
pan_backtrace();
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 0089282..814005a 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -296,7 +296,7 @@ SES_Wait(struct sess *sp)
sp->waited.fd = sp->fd;
sp->waited.ptr = sp;
sp->waited.deadline = sp->t_idle;
- if (WAIT_Enter(pp->http1_waiter, &sp->waited)) {
+ if (Wait_Enter(pp->http1_waiter, &sp->waited)) {
VSC_C_main->sess_pipe_overflow++;
SES_Delete(sp, SC_SESS_PIPE_OVERFLOW, NAN);
}
@@ -467,7 +467,7 @@ SES_NewPool(struct pool *wp, unsigned pool_no)
bprintf(nb, "sess%u", pool_no);
pp->mpl_sess = MPL_New(nb, &cache_param->sess_pool,
&cache_param->workspace_session);
- pp->http1_waiter = WAIT_Init(ses_handle, &cache_param->timeout_idle);
+ pp->http1_waiter = Wait_New(ses_handle, &cache_param->timeout_idle);
return (pp);
}
diff --git a/bin/varnishd/mgt/mgt_param_tweak.c b/bin/varnishd/mgt/mgt_param_tweak.c
index 699fc79..f989307 100644
--- a/bin/varnishd/mgt/mgt_param_tweak.c
+++ b/bin/varnishd/mgt/mgt_param_tweak.c
@@ -574,7 +574,7 @@ tweak_waiter(struct vsb *vsb, const struct parspec *par, const char *arg)
/* XXX should have tweak_generic_string */
(void)par;
- return (WAIT_tweak_waiter(vsb, arg));
+ return (Wait_Argument(vsb, arg));
}
/*--------------------------------------------------------------------*/
diff --git a/bin/varnishd/waiter/cache_waiter.c b/bin/varnishd/waiter/cache_waiter.c
index c5fed78..4b8fd6e 100644
--- a/bin/varnishd/waiter/cache_waiter.c
+++ b/bin/varnishd/waiter/cache_waiter.c
@@ -45,7 +45,7 @@
#define NEV 8192
const char *
-WAIT_GetName(void)
+Wait_GetName(void)
{
if (waiter != NULL)
@@ -55,7 +55,7 @@ WAIT_GetName(void)
}
struct waiter *
-WAIT_Init(waiter_handle_f *func, volatile double *tmo)
+Wait_New(waiter_handle_f *func, volatile double *tmo)
{
struct waiter *w;
@@ -70,7 +70,7 @@ WAIT_Init(waiter_handle_f *func, volatile double *tmo)
w->impl = waiter;
w->func = func;
w->tmo = tmo;
- VTAILQ_INIT(&w->sesshead);
+ VTAILQ_INIT(&w->waithead);
waiter->init(w);
AN(w->impl->pass || w->pfd > 0);
@@ -78,7 +78,7 @@ WAIT_Init(waiter_handle_f *func, volatile double *tmo)
}
void
-WAIT_UsePipe(struct waiter *w)
+Wait_UsePipe(struct waiter *w)
{
CHECK_OBJ_NOTNULL(w, WAITER_MAGIC);
@@ -90,12 +90,12 @@ WAIT_UsePipe(struct waiter *w)
ALLOC_OBJ(w->pipe_w, WAITED_MAGIC);
w->pipe_w->fd = w->pipes[0];
w->pipe_w->deadline = 9e99;
- VTAILQ_INSERT_HEAD(&w->sesshead, w->pipe_w, list);
+ VTAILQ_INSERT_HEAD(&w->waithead, w->pipe_w, list);
waiter->inject(w, w->pipe_w);
}
int
-WAIT_Enter(const struct waiter *w, struct waited *wp)
+Wait_Enter(const struct waiter *w, struct waited *wp)
{
ssize_t written;
@@ -116,7 +116,7 @@ WAIT_Enter(const struct waiter *w, struct waited *wp)
}
void
-WAIT_handle(struct waiter *w, struct waited *wp, enum wait_event ev, double now)
+Wait_Handle(struct waiter *w, struct waited *wp, enum wait_event ev, double now)
{
struct waited *ss[NEV];
int i, j;
@@ -131,7 +131,7 @@ WAIT_handle(struct waiter *w, struct waited *wp, enum wait_event ev, double now)
for (j = 0; i >= sizeof ss[0]; j++, i -= sizeof ss[0]) {
CHECK_OBJ_NOTNULL(ss[j], WAITED_MAGIC);
assert(ss[j]->fd >= 0);
- VTAILQ_INSERT_TAIL(&w->sesshead, ss[j], list);
+ VTAILQ_INSERT_TAIL(&w->waithead, ss[j], list);
w->impl->inject(w, ss[j]);
}
AZ(i);
@@ -140,6 +140,6 @@ WAIT_handle(struct waiter *w, struct waited *wp, enum wait_event ev, double now)
if (w->impl->evict != NULL)
w->impl->evict(w, wp);
- VTAILQ_REMOVE(&w->sesshead, wp, list);
+ VTAILQ_REMOVE(&w->waithead, wp, list);
w->func(wp, ev, now);
}
diff --git a/bin/varnishd/waiter/cache_waiter_epoll.c b/bin/varnishd/waiter/cache_waiter_epoll.c
index 85026c6..a281f6b 100644
--- a/bin/varnishd/waiter/cache_waiter_epoll.c
+++ b/bin/varnishd/waiter/cache_waiter_epoll.c
@@ -92,13 +92,13 @@ vwe_eev(struct vwe *vwe, const struct epoll_event *ep, double now)
AN(ep->data.ptr);
CAST_OBJ_NOTNULL(sp, ep->data.ptr, WAITED_MAGIC);
if (ep->events & EPOLLIN || ep->events & EPOLLPRI) {
- WAIT_handle(vwe->waiter, sp, WAITER_ACTION, now);
+ Wait_Handle(vwe->waiter, sp, WAITER_ACTION, now);
} else if (ep->events & EPOLLERR) {
- WAIT_handle(vwe->waiter, sp, WAITER_REMCLOSE, now);
+ Wait_Handle(vwe->waiter, sp, WAITER_REMCLOSE, now);
} else if (ep->events & EPOLLHUP) {
- WAIT_handle(vwe->waiter, sp, WAITER_REMCLOSE, now);
+ Wait_Handle(vwe->waiter, sp, WAITER_REMCLOSE, now);
} else if (ep->events & EPOLLRDHUP) {
- WAIT_handle(vwe->waiter, sp, WAITER_REMCLOSE, now);
+ Wait_Handle(vwe->waiter, sp, WAITER_REMCLOSE, now);
}
}
@@ -136,9 +136,9 @@ vwe_thread(void *priv)
/* check for timeouts */
deadline = now - *vwe->waiter->tmo;
- VTAILQ_FOREACH_SAFE(sp, &vwe->waiter->sesshead, list, sp2) {
+ VTAILQ_FOREACH_SAFE(sp, &vwe->waiter->waithead, list, sp2) {
if (sp->deadline < deadline)
- WAIT_handle(vwe->waiter, sp,
+ Wait_Handle(vwe->waiter, sp,
WAITER_TIMEOUT, now);
}
}
@@ -180,7 +180,7 @@ vwe_init(struct waiter *w)
vwe->epfd = epoll_create(1);
assert(vwe->epfd >= 0);
- WAIT_UsePipe(w);
+ Wait_UsePipe(w);
AZ(pipe(vwe->timer_pipes));
AZ(VFIL_nonblocking(vwe->timer_pipes[0]));
diff --git a/bin/varnishd/waiter/cache_waiter_kqueue.c b/bin/varnishd/waiter/cache_waiter_kqueue.c
index 0170eb4..422dabe 100644
--- a/bin/varnishd/waiter/cache_waiter_kqueue.c
+++ b/bin/varnishd/waiter/cache_waiter_kqueue.c
@@ -110,10 +110,10 @@ vwk_sess_ev(const struct vwk *vwk, const struct kevent *kp, double now)
CAST_OBJ_NOTNULL(sp, kp->udata, WAITED_MAGIC);
if (kp->data > 0) {
- WAIT_handle(vwk->waiter, sp, WAITER_ACTION, now);
+ Wait_Handle(vwk->waiter, sp, WAITER_ACTION, now);
return;
} else if (kp->flags & EV_EOF) {
- WAIT_handle(vwk->waiter, sp, WAITER_REMCLOSE, now);
+ Wait_Handle(vwk->waiter, sp, WAITER_REMCLOSE, now);
return;
} else {
WRONG("unknown kqueue state");
@@ -171,12 +171,12 @@ vwk_thread(void *priv)
vwk_kq_flush(vwk);
deadline = now - *vwk->waiter->tmo;
for (;;) {
- sp = VTAILQ_FIRST(&vwk->waiter->sesshead);
+ sp = VTAILQ_FIRST(&vwk->waiter->waithead);
if (sp == NULL)
break;
if (sp->deadline > deadline)
break;
- WAIT_handle(vwk->waiter, sp, WAITER_TIMEOUT, now);
+ Wait_Handle(vwk->waiter, sp, WAITER_TIMEOUT, now);
}
}
NEEDLESS_RETURN(NULL);
@@ -197,7 +197,7 @@ vwk_init(struct waiter *w)
EV_SET(&vwk->ki[vwk->nki], 0, EVFILT_TIMER, EV_ADD, 0, 100, NULL);
vwk->nki++;
- WAIT_UsePipe(w);
+ Wait_UsePipe(w);
AZ(pthread_create(&vwk->thread, NULL, vwk_thread, vwk));
}
diff --git a/bin/varnishd/waiter/cache_waiter_poll.c b/bin/varnishd/waiter/cache_waiter_poll.c
index 44beabc..dfaac80 100644
--- a/bin/varnishd/waiter/cache_waiter_poll.c
+++ b/bin/varnishd/waiter/cache_waiter_poll.c
@@ -146,7 +146,7 @@ vwp_main(void *priv)
v2 = v;
now = VTIM_real();
deadline = now - *vwp->waiter->tmo;
- VTAILQ_FOREACH_SAFE(sp, &vwp->waiter->sesshead, list, sp2) {
+ VTAILQ_FOREACH_SAFE(sp, &vwp->waiter->waithead, list, sp2) {
if (v != 0 && v2 == 0)
break;
CHECK_OBJ_NOTNULL(sp, WAITED_MAGIC);
@@ -158,10 +158,10 @@ vwp_main(void *priv)
if (vwp->pollfd[fd].revents) {
v2--;
vwp->pollfd[fd].revents = 0;
- WAIT_handle(vwp->waiter, sp, WAITER_ACTION,
+ Wait_Handle(vwp->waiter, sp, WAITER_ACTION,
now);
} else if (sp->deadline <= deadline) {
- WAIT_handle(vwp->waiter, sp, WAITER_TIMEOUT,
+ Wait_Handle(vwp->waiter, sp, WAITER_TIMEOUT,
now);
}
}
@@ -182,7 +182,7 @@ vwp_poll_init(struct waiter *w)
vwp->waiter = w;
vwp_pollspace(vwp, 256);
- WAIT_UsePipe(w);
+ Wait_UsePipe(w);
AZ(pthread_create(&vwp->poll_thread, NULL, vwp_main, vwp));
}
diff --git a/bin/varnishd/waiter/cache_waiter_ports.c b/bin/varnishd/waiter/cache_waiter_ports.c
index 9bd110a..76dad22 100644
--- a/bin/varnishd/waiter/cache_waiter_ports.c
+++ b/bin/varnishd/waiter/cache_waiter_ports.c
@@ -79,7 +79,7 @@ vws_port_ev(struct vws *vws, port_event_t *ev, double now) {
if(ev->portev_source == PORT_SOURCE_USER) {
CAST_OBJ_NOTNULL(sp, ev->portev_user, WAITED_MAGIC);
assert(sp->fd >= 0);
- VTAILQ_INSERT_TAIL(&vws->waiter->sesshead, sp, list);
+ VTAILQ_INSERT_TAIL(&vws->waiter->waithead, sp, list);
vws_add(vws, sp->fd, sp);
} else {
assert(ev->portev_source == PORT_SOURCE_FD);
@@ -87,7 +87,7 @@ vws_port_ev(struct vws *vws, port_event_t *ev, double now) {
assert(sp->fd >= 0);
if(ev->portev_events & POLLERR) {
vws_del(vws, sp->fd);
- WAIT_handle(vws->waiter, sp, WAITER_REMCLOSE, now);
+ Wait_Handle(vws->waiter, sp, WAITER_REMCLOSE, now);
return;
}
@@ -105,7 +105,7 @@ vws_port_ev(struct vws *vws, port_event_t *ev, double now) {
* threadID=129476&tstart=0
*/
vws_del(vws, sp->fd);
- WAIT_handle(vws->waiter, sp, WAITER_ACTION, now);
+ Wait_Handle(vws->waiter, sp, WAITER_ACTION, now);
}
return;
}
@@ -199,14 +199,14 @@ vws_thread(void *priv)
*/
for (;;) {
- sp = VTAILQ_FIRST(&vws->waiter->sesshead);
+ sp = VTAILQ_FIRST(&vws->waiter->waithead);
if (sp == NULL)
break;
if (sp->deadline > deadline) {
break;
}
vws_del(vws, sp->fd);
- WAIT_handle(vws->waiter, sp, WAITER_TIMEOUT, now);
+ Wait_Handle(vws->waiter, sp, WAITER_TIMEOUT, now);
}
/*
diff --git a/bin/varnishd/waiter/mgt_waiter.c b/bin/varnishd/waiter/mgt_waiter.c
index 54c3c34..18e370c 100644
--- a/bin/varnishd/waiter/mgt_waiter.c
+++ b/bin/varnishd/waiter/mgt_waiter.c
@@ -55,7 +55,7 @@ static const struct waiter_impl *const waiter_impls[] = {
struct waiter_impl const *waiter;
int
-WAIT_tweak_waiter(struct vsb *vsb, const char *arg)
+Wait_Argument(struct vsb *vsb, const char *arg)
{
int i;
diff --git a/bin/varnishd/waiter/waiter.h b/bin/varnishd/waiter/waiter.h
index be9791d..4c41001 100644
--- a/bin/varnishd/waiter/waiter.h
+++ b/bin/varnishd/waiter/waiter.h
@@ -56,9 +56,9 @@ enum wait_event {
typedef void waiter_handle_f(struct waited *, enum wait_event, double now);
/* cache_waiter.c */
-int WAIT_Enter(const struct waiter *, struct waited *);
-struct waiter *WAIT_Init(waiter_handle_f *, volatile double *timeout);
-const char *WAIT_GetName(void);
+int Wait_Enter(const struct waiter *, struct waited *);
+struct waiter *Wait_New(waiter_handle_f *, volatile double *timeout);
+const char *Wait_GetName(void);
/* mgt_waiter.c */
-int WAIT_tweak_waiter(struct vsb *vsb, const char *arg);
+int Wait_Argument(struct vsb *vsb, const char *arg);
diff --git a/bin/varnishd/waiter/waiter_priv.h b/bin/varnishd/waiter/waiter_priv.h
index a277327..336328d 100644
--- a/bin/varnishd/waiter/waiter_priv.h
+++ b/bin/varnishd/waiter/waiter_priv.h
@@ -41,7 +41,7 @@ struct waiter {
struct waited *pipe_w;
volatile double *tmo;
- VTAILQ_HEAD(,waited) sesshead;
+ VTAILQ_HEAD(,waited) waithead;
void *priv;
int pfd;
@@ -62,8 +62,8 @@ struct waiter_impl {
};
/* cache_waiter.c */
-void WAIT_handle(struct waiter *, struct waited *, enum wait_event, double now);
-void WAIT_UsePipe(struct waiter *w);
+void Wait_Handle(struct waiter *, struct waited *, enum wait_event, double now);
+void Wait_UsePipe(struct waiter *w);
/* mgt_waiter.c */
extern struct waiter_impl const * waiter;
More information about the varnish-commit
mailing list