Commit 20068bc9 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

OK, pass the objcore instead, we don't have the sess in the stevedore.



git-svn-id: http://www.varnish-cache.org/svn/trunk@4267 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent f2481ad3
......@@ -64,7 +64,7 @@ fetch_straight(struct sess *sp, struct http_conn *htc, const char *b)
assert((uintmax_t)cl == cll); /* Protect against bogusly large values */
while (cl > 0) {
st = STV_alloc(sp, cl);
st = STV_alloc(sp, cl, NULL);
VTAILQ_INSERT_TAIL(&sp->obj->store, st, list);
sl = st->space;
if (sl > cl)
......@@ -164,7 +164,7 @@ fetch_chunked(struct sess *sp, struct http_conn *htc)
v = u;
if (u < params->fetch_chunksize * 1024)
v = params->fetch_chunksize * 1024;
st = STV_alloc(sp, v);
st = STV_alloc(sp, v, NULL);
VTAILQ_INSERT_TAIL(&sp->obj->store, st, list);
}
v = st->space - st->len;
......@@ -247,7 +247,7 @@ fetch_eof(struct sess *sp, struct http_conn *htc)
if (v == 0) {
if (st != NULL && fetchfrag > 0)
dump_st(sp, st);
st = STV_alloc(sp, params->fetch_chunksize * 1024LL);
st = STV_alloc(sp, params->fetch_chunksize * 1024LL, NULL);
VTAILQ_INSERT_TAIL(&sp->obj->store, st, list);
p = st->ptr + st->len;
v = st->space - st->len;
......
......@@ -127,7 +127,7 @@ STV_NewObject(struct sess *sp, unsigned l, double ttl)
STV_InitObj(sp, o, l);
return (o);
}
st = STV_alloc(sp, sizeof *o + l);
st = STV_alloc(sp, sizeof *o + l, sp->objcore);
XXXAN(st);
xxxassert(st->space >= (sizeof *o + l));
......@@ -143,7 +143,7 @@ STV_NewObject(struct sess *sp, unsigned l, double ttl)
/*********************************************************************/
struct storage *
STV_alloc(struct sess *sp, size_t size)
STV_alloc(struct sess *sp, size_t size, struct objcore *oc)
{
struct storage *st;
struct stevedore *stv = NULL;
......@@ -169,7 +169,7 @@ STV_alloc(struct sess *sp, size_t size)
/* try to allocate from it */
AN(stv->alloc);
st = stv->alloc(stv, size, 0);
st = stv->alloc(stv, size, oc);
if (st != NULL)
break;
......
......@@ -33,10 +33,11 @@ struct stevedore;
struct sess;
struct iovec;
struct object;
struct objcore;
typedef void storage_init_f(struct stevedore *, int ac, char * const *av);
typedef void storage_open_f(const struct stevedore *);
typedef struct storage *storage_alloc_f(struct stevedore *, size_t size, int isobj);
typedef struct storage *storage_alloc_f(struct stevedore *, size_t size, struct objcore *);
typedef struct object *storage_alloc_obj_f(struct stevedore *, size_t size, double ttl);
typedef void storage_trim_f(struct storage *, size_t size);
typedef void storage_free_f(struct storage *);
......@@ -66,7 +67,7 @@ struct stevedore {
};
struct object *STV_NewObject(struct sess *sp, unsigned len, double ttl);
struct storage *STV_alloc(struct sess *sp, size_t size);
struct storage *STV_alloc(struct sess *sp, size_t size, struct objcore *oc);
void STV_trim(struct storage *st, size_t size);
void STV_free(struct storage *st);
void STV_add(const struct stevedore *stv, int ac, char * const *av);
......
......@@ -461,12 +461,12 @@ smf_open(const struct stevedore *st)
/*--------------------------------------------------------------------*/
static struct storage *
smf_alloc(struct stevedore *st, size_t size, int isobj)
smf_alloc(struct stevedore *st, size_t size, struct objcore *oc)
{
struct smf *smf;
struct smf_sc *sc = st->priv;
(void)isobj;
(void)oc;
assert(size > 0);
size += (sc->pagesize - 1);
size &= ~(sc->pagesize - 1);
......
......@@ -53,11 +53,11 @@ struct sma {
};
static struct storage *
sma_alloc(struct stevedore *st, size_t size, int isobj)
sma_alloc(struct stevedore *st, size_t size, struct objcore *oc)
{
struct sma *sma;
(void)isobj;
(void)oc;
Lck_Lock(&sma_mtx);
VSL_stats->sma_nreq++;
if (VSL_stats->sma_nbytes + size > sma_max)
......
......@@ -1220,14 +1220,14 @@ smp_object(const struct sess *sp)
*/
static struct storage *
smp_alloc(struct stevedore *st, size_t size, int isobj)
smp_alloc(struct stevedore *st, size_t size, struct objcore *oc)
{
struct smp_sc *sc;
struct storage *ss;
struct smp_seg *sg;
size_t sz2;
(void)isobj;
(void)oc;
CAST_OBJ_NOTNULL(sc, st->priv, SMP_SC_MAGIC);
Lck_Lock(&sc->mtx);
......
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