r4267 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Oct 1 11:12:09 CEST 2009


Author: phk
Date: 2009-10-01 11:12:09 +0200 (Thu, 01 Oct 2009)
New Revision: 4267

Modified:
   trunk/varnish-cache/bin/varnishd/cache_fetch.c
   trunk/varnish-cache/bin/varnishd/stevedore.c
   trunk/varnish-cache/bin/varnishd/stevedore.h
   trunk/varnish-cache/bin/varnishd/storage_file.c
   trunk/varnish-cache/bin/varnishd/storage_malloc.c
   trunk/varnish-cache/bin/varnishd/storage_persistent.c
Log:
OK, pass the objcore instead, we don't have the sess in the stevedore.



Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c	2009-10-01 08:58:05 UTC (rev 4266)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c	2009-10-01 09:12:09 UTC (rev 4267)
@@ -64,7 +64,7 @@
 	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 @@
 				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 @@
 		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;

Modified: trunk/varnish-cache/bin/varnishd/stevedore.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.c	2009-10-01 08:58:05 UTC (rev 4266)
+++ trunk/varnish-cache/bin/varnishd/stevedore.c	2009-10-01 09:12:09 UTC (rev 4267)
@@ -127,7 +127,7 @@
 		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 @@
 /*********************************************************************/
 
 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 @@
 
 		/* try to allocate from it */
 		AN(stv->alloc);
-		st = stv->alloc(stv, size, 0);
+		st = stv->alloc(stv, size, oc);
 		if (st != NULL)
 			break;
 

Modified: trunk/varnish-cache/bin/varnishd/stevedore.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.h	2009-10-01 08:58:05 UTC (rev 4266)
+++ trunk/varnish-cache/bin/varnishd/stevedore.h	2009-10-01 09:12:09 UTC (rev 4267)
@@ -33,10 +33,11 @@
 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 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);

Modified: trunk/varnish-cache/bin/varnishd/storage_file.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_file.c	2009-10-01 08:58:05 UTC (rev 4266)
+++ trunk/varnish-cache/bin/varnishd/storage_file.c	2009-10-01 09:12:09 UTC (rev 4267)
@@ -461,12 +461,12 @@
 /*--------------------------------------------------------------------*/
 
 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);

Modified: trunk/varnish-cache/bin/varnishd/storage_malloc.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_malloc.c	2009-10-01 08:58:05 UTC (rev 4266)
+++ trunk/varnish-cache/bin/varnishd/storage_malloc.c	2009-10-01 09:12:09 UTC (rev 4267)
@@ -53,11 +53,11 @@
 };
 
 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)

Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_persistent.c	2009-10-01 08:58:05 UTC (rev 4266)
+++ trunk/varnish-cache/bin/varnishd/storage_persistent.c	2009-10-01 09:12:09 UTC (rev 4267)
@@ -1220,14 +1220,14 @@
  */
 
 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);



More information about the varnish-commit mailing list