Commit 000f1991 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Tollef Fog Heen

Make EXP_NukeOne() make do with a struct worker arg instead of sess.

parent f85a52c0
......@@ -714,7 +714,7 @@ void EXP_Inject(struct objcore *oc, struct lru *lru, double when);
void EXP_Init(void);
void EXP_Rearm(const struct object *o);
int EXP_Touch(struct objcore *oc);
int EXP_NukeOne(const struct sess *sp, struct lru *lru);
int EXP_NukeOne(struct worker *w, struct lru *lru);
/* cache_fetch.c */
struct storage *FetchStorage(const struct sess *sp, ssize_t sz);
......
......@@ -441,8 +441,8 @@ cnt_error(struct sess *sp)
&w->exp, (uint16_t)params->http_max_hdr);
if (sp->obj == NULL)
sp->obj = STV_NewObject(sp, TRANSIENT_STORAGE,
params->http_resp_size , &w->exp,
(uint16_t)params->http_max_hdr);
params->http_resp_size, &w->exp,
(uint16_t)params->http_max_hdr);
if (sp->obj == NULL) {
sp->doclose = "Out of objects";
sp->director = NULL;
......
......@@ -417,7 +417,7 @@ exp_timer(struct sess *sp, void *priv)
*/
int
EXP_NukeOne(const struct sess *sp, struct lru *lru)
EXP_NukeOne(struct worker *w, struct lru *lru)
{
struct objcore *oc;
struct object *o;
......@@ -449,9 +449,9 @@ EXP_NukeOne(const struct sess *sp, struct lru *lru)
return (-1);
/* XXX: bad idea for -spersistent */
o = oc_getobj(sp->wrk, oc);
WSL(sp->wrk, SLT_ExpKill, 0, "%u LRU", o->xid);
(void)HSH_Deref(sp->wrk, NULL, &o);
o = oc_getobj(w, oc);
WSL(w, SLT_ExpKill, 0, "%u LRU", o->xid);
(void)HSH_Deref(w, NULL, &o);
return (1);
}
......
......@@ -1003,7 +1003,6 @@ http_PutResponse(struct worker *w, int fd, const struct http *to,
if (to->hd[HTTP_HDR_RESPONSE].b == NULL)
http_SetH(to, HTTP_HDR_RESPONSE, "Lost Response");
Tcheck(to->hd[HTTP_HDR_RESPONSE]);
}
void
......
......@@ -183,7 +183,7 @@ stv_alloc(const struct sess *sp, size_t size)
}
/* no luck; try to free some space and keep trying */
if (EXP_NukeOne(sp, stv->lru) == -1)
if (EXP_NukeOne(sp->wrk, stv->lru) == -1)
break;
/* Enough is enough: try another if we have one */
......@@ -335,7 +335,7 @@ STV_NewObject(struct sess *sp, const char *hint, unsigned wsl, struct exp *ep,
if (o == NULL) {
/* no luck; try to free some space and keep trying */
for (i = 0; o == NULL && i < params->nuke_limit; i++) {
if (EXP_NukeOne(sp, stv->lru) == -1)
if (EXP_NukeOne(sp->wrk, stv->lru) == -1)
break;
o = stv->allocobj(stv, sp, ltot, &soc);
}
......
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