[master] bdc6f73 Eliminate req->obj.
Poul-Henning Kamp
phk at FreeBSD.org
Mon Aug 18 09:54:39 CEST 2014
commit bdc6f7343e1267f69792a08b8f1031fbe54636c6
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Mon Aug 18 07:54:13 2014 +0000
Eliminate req->obj.
Until reimplemented we have slightly less info in panics about objects.
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 6bcecd6..8d718fa 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -651,7 +651,6 @@ struct req {
struct http *resp;
struct ws ws[1];
- struct object *obj;
struct objcore *objcore;
struct objcore *ims_oc;
/* Lookup stuff */
diff --git a/bin/varnishd/cache/cache_http1_deliver.c b/bin/varnishd/cache/cache_http1_deliver.c
index 194193a..202ae12 100644
--- a/bin/varnishd/cache/cache_http1_deliver.c
+++ b/bin/varnishd/cache/cache_http1_deliver.c
@@ -372,7 +372,6 @@ V1D_Deliver_Synth(struct req *req)
char *r;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
- AZ(req->obj);
AN(req->synth_body);
req->res_mode = 0;
diff --git a/bin/varnishd/cache/cache_http1_fsm.c b/bin/varnishd/cache/cache_http1_fsm.c
index 4290c47..b0c5299 100644
--- a/bin/varnishd/cache/cache_http1_fsm.c
+++ b/bin/varnishd/cache/cache_http1_fsm.c
@@ -101,7 +101,6 @@ http1_wait(struct sess *sp, struct worker *wrk, struct req *req)
assert(req->sp == sp);
AZ(req->vcl);
- AZ(req->obj);
AZ(req->esi_level);
AZ(isnan(sp->t_idle));
assert(isnan(req->t_first));
@@ -190,7 +189,6 @@ http1_cleanup(struct sess *sp, struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_ORNULL(req->vcl, VCL_CONF_MAGIC);
- AZ(req->obj);
req->director_hint = NULL;
req->restarts = 0;
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 43919d7..4a1c880 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -154,6 +154,7 @@ pan_vbc(const struct vbc *vbc)
/*--------------------------------------------------------------------*/
+#if 0
static void
pan_storage(const struct storage *st)
{
@@ -186,6 +187,7 @@ pan_storage(const struct storage *st)
#undef show
#undef MAX_BYTES
}
+#endif
/*--------------------------------------------------------------------*/
@@ -210,6 +212,7 @@ pan_http(const char *id, const struct http *h, int indent)
/*--------------------------------------------------------------------*/
+#if 0
static void
pan_object(const char *typ, const struct object *o)
{
@@ -225,6 +228,7 @@ pan_object(const char *typ, const struct object *o)
VSB_printf(pan_vsp, " },\n");
VSB_printf(pan_vsp, " },\n");
}
+#endif
/*--------------------------------------------------------------------*/
@@ -394,10 +398,10 @@ pan_req(const struct req *req)
if (VALID_OBJ(req->vcl, VCL_CONF_MAGIC))
pan_vcl(req->vcl);
- if (VALID_OBJ(req->obj, OBJECT_MAGIC)) {
+ if (req->objcore != NULL) {
+ pan_objcore("REQ", req->objcore);
if (req->objcore->busyobj != NULL)
pan_busyobj(req->objcore->busyobj);
- pan_object("REQ", req->obj);
}
VSB_printf(pan_vsp, "},\n");
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 0f27c48..7ab29ac 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -96,9 +96,6 @@ cnt_deliver(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL(req->vcl, VCL_CONF_MAGIC);
assert(WRW_IsReleased(wrk));
- req->obj = ObjGetObj(req->objcore, &wrk->stats);
- CHECK_OBJ_NOTNULL(req->obj, OBJECT_MAGIC);
-
assert(req->objcore->refcnt > 0);
if (req->objcore->exp_flags & OC_EF_EXP)
@@ -144,7 +141,6 @@ cnt_deliver(struct worker *wrk, struct req *req)
if (wrk->handling != VCL_RET_DELIVER) {
assert(req->objcore == req->objcore);
(void)HSH_DerefObjCore(&wrk->stats, &req->objcore);
- req->obj = NULL;
http_Teardown(req->resp);
switch (wrk->handling) {
@@ -194,10 +190,7 @@ cnt_deliver(struct worker *wrk, struct req *req)
}
assert(WRW_IsReleased(wrk));
-VSLb(req->vsl, SLT_Debug, "XXX REF %d", req->objcore->refcnt);
- assert(req->obj->objcore == req->objcore);
(void)HSH_DerefObjCore(&wrk->stats, &req->objcore);
- req->obj = NULL;
http_Teardown(req->resp);
return (REQ_FSM_DONE);
}
@@ -297,7 +290,6 @@ cnt_fetch(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->objcore, OBJCORE_MAGIC);
- AZ(req->obj);
wrk->stats.s_fetch++;
(void)HTTP1_DiscardReqBody(req);
@@ -388,7 +380,6 @@ cnt_lookup(struct worker *wrk, struct req *req)
/* Found nothing */
VSLb(req->vsl, SLT_Debug, "XXXX MISS");
AZ(oc);
- AZ(req->obj);
AN(boc);
AN(boc->flags & OC_F_BUSY);
req->objcore = boc;
@@ -406,7 +397,6 @@ cnt_lookup(struct worker *wrk, struct req *req)
VSLb(req->vsl, SLT_HitPass, "%u",
ObjGetXID(req->objcore, &wrk->stats));
AZ(boc);
- AZ(req->obj);
(void)HSH_DerefObjCore(&wrk->stats, &req->objcore);
wrk->stats.cache_hitpass++;
req->req_step = R_STP_PASS;
@@ -432,7 +422,6 @@ cnt_lookup(struct worker *wrk, struct req *req)
req->req_step = R_STP_DELIVER;
return (REQ_FSM_MORE);
case VCL_RET_FETCH:
- AZ(req->obj);
if (boc != NULL) {
req->objcore = boc;
req->ims_oc = oc;
@@ -464,7 +453,6 @@ cnt_lookup(struct worker *wrk, struct req *req)
}
/* Drop our object, we won't need it */
- AZ(req->obj);
(void)HSH_DerefObjCore(&wrk->stats, &req->objcore);
if (boc != NULL) {
@@ -551,7 +539,6 @@ cnt_pass(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->vcl, VCL_CONF_MAGIC);
AZ(req->objcore);
- AZ(req->obj);
VCL_pass_method(req->vcl, wrk, req, NULL, req->http->ws);
switch (wrk->handling) {
@@ -696,7 +683,6 @@ cnt_recv(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->vcl, VCL_CONF_MAGIC);
AZ(req->objcore);
- AZ(req->obj);
AZ(isnan(req->t_first));
AZ(isnan(req->t_prev));
@@ -860,8 +846,8 @@ cnt_diag(struct req *req, const char *state)
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
- VSLb(req->vsl, SLT_Debug, "vxid %u STP_%s sp %p obj %p vcl %p",
- req->vsl->wid, state, req->sp, req->obj, req->vcl);
+ VSLb(req->vsl, SLT_Debug, "vxid %u STP_%s sp %p vcl %p",
+ req->vsl->wid, state, req->sp, req->vcl);
VSL_Flush(req->vsl, 0);
}
More information about the varnish-commit
mailing list