Commit 0041032c authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Let the body-fetching thread Unbusy the object.

parent cf81441e
......@@ -929,13 +929,6 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
return (0);
}
if (req->obj->objcore != NULL) {
EXP_Insert(req->obj);
AN(req->obj->objcore);
AN(req->obj->objcore->ban);
AZ(req->obj->ws_o->overflow);
HSH_Unbusy(&wrk->stats, req->obj->objcore);
}
VBO_DerefBusyObj(wrk, &req->busyobj);
wrk->acct_tmp.fetch++;
sp->step = STP_PREPRESP;
......
......@@ -35,6 +35,8 @@
#include "cache.h"
#include "hash/hash_slinger.h"
#include "cache_backend.h"
#include "vcli_priv.h"
#include "vct.h"
......@@ -674,13 +676,22 @@ FetchBody(struct worker *wrk, void *priv)
"Content-Length: %zd", obj->len);
}
bo->state = BOS_FINISHED;
if (cls)
VDI_CloseFd(&bo->vbc);
else
VDI_RecycleFd(&bo->vbc);
if (obj->objcore != NULL) {
EXP_Insert(obj);
AN(obj->objcore->ban);
AZ(obj->ws_o->overflow);
HSH_Unbusy(&wrk->stats, obj->objcore);
}
/* XXX: Atomic assignment, needs volatile/membar ? */
bo->state = BOS_FINISHED;
}
bo->stats = NULL;
VBO_DerefBusyObj(wrk, &bo);
......
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