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

Move Add/DelDirector into VRT, vmods will need to call them.

parent 4e701d69
......@@ -499,7 +499,7 @@ VRT_new_backend_clustered(VRT_CTX, struct vsmw_cluster *vc,
"%s.%s", VCL_Name(ctx->vcl), vrt->vcl_name);
AN(be->vsc);
retval = VCL_AddDirector(ctx->vcl, d, vrt->vcl_name);
retval = VRT_AddDirector(ctx, d, vrt->vcl_name);
if (retval == 0)
return (d);
......@@ -571,7 +571,7 @@ VBE_Poll(void)
if (be->n_conn > 0)
continue;
Lck_Unlock(&backends_mtx);
VCL_DelDirector(be->director);
VRT_DelDirector(NULL, be->director);
Lck_Lock(&backends_mtx);
}
Lck_Unlock(&backends_mtx);
......
......@@ -92,8 +92,8 @@ struct director {
unsigned VDI_Healthy(const struct director *, double *);
/* cache_vcl.c */
int VCL_AddDirector(struct vcl *, struct director *, const char *);
void VCL_DelDirector(struct director *);
int VRT_AddDirector(VRT_CTX, struct director *, const char *);
void VRT_DelDirector(VRT_CTX, struct director *);
/* cache_director.c */
......
......@@ -126,13 +126,16 @@ VCL_Rel(struct vcl **vcc)
/*--------------------------------------------------------------------*/
int
VCL_AddDirector(struct vcl *vcl, struct director *d, const char *vcl_name)
VRT_AddDirector(VRT_CTX, struct director *d, const char *vcl_name)
{
struct vsb *vsb;
struct vcl *vcl;
vcl = ctx->vcl;
CHECK_OBJ_NOTNULL(vcl, VCL_MAGIC);
CHECK_OBJ_NOTNULL(d, DIRECTOR_MAGIC);
AN(d->destroy);
d->admin_health = VDI_AH_PROBE;
vsb = VSB_new_auto();
AN(vsb);
......@@ -163,10 +166,11 @@ VCL_AddDirector(struct vcl *vcl, struct director *d, const char *vcl_name)
}
void
VCL_DelDirector(struct director *d)
VRT_DelDirector(VRT_CTX, struct director *d)
{
struct vcl *vcl;
(void)ctx;
CHECK_OBJ_NOTNULL(d, DIRECTOR_MAGIC);
vcl = d->vcl;
CHECK_OBJ_NOTNULL(vcl, VCL_MAGIC);
......
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