r4266 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Oct 1 10:58:06 CEST 2009


Author: phk
Date: 2009-10-01 10:58:05 +0200 (Thu, 01 Oct 2009)
New Revision: 4266

Modified:
   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:
Give the stevedores alloc method a flag that tells that we are allocating
an object structure.



Modified: trunk/varnish-cache/bin/varnishd/stevedore.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.c	2009-09-30 08:40:01 UTC (rev 4265)
+++ trunk/varnish-cache/bin/varnishd/stevedore.c	2009-10-01 08:58:05 UTC (rev 4266)
@@ -169,7 +169,7 @@
 
 		/* try to allocate from it */
 		AN(stv->alloc);
-		st = stv->alloc(stv, size);
+		st = stv->alloc(stv, size, 0);
 		if (st != NULL)
 			break;
 

Modified: trunk/varnish-cache/bin/varnishd/stevedore.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.h	2009-09-30 08:40:01 UTC (rev 4265)
+++ trunk/varnish-cache/bin/varnishd/stevedore.h	2009-10-01 08:58:05 UTC (rev 4266)
@@ -36,7 +36,7 @@
 
 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);
+typedef struct storage *storage_alloc_f(struct stevedore *, size_t size, int isobj);
 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 *);

Modified: trunk/varnish-cache/bin/varnishd/storage_file.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_file.c	2009-09-30 08:40:01 UTC (rev 4265)
+++ trunk/varnish-cache/bin/varnishd/storage_file.c	2009-10-01 08:58:05 UTC (rev 4266)
@@ -461,11 +461,12 @@
 /*--------------------------------------------------------------------*/
 
 static struct storage *
-smf_alloc(struct stevedore *st, size_t size)
+smf_alloc(struct stevedore *st, size_t size, int isobj)
 {
 	struct smf *smf;
 	struct smf_sc *sc = st->priv;
 
+	(void)isobj;
 	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-09-30 08:40:01 UTC (rev 4265)
+++ trunk/varnish-cache/bin/varnishd/storage_malloc.c	2009-10-01 08:58:05 UTC (rev 4266)
@@ -53,10 +53,11 @@
 };
 
 static struct storage *
-sma_alloc(struct stevedore *st, size_t size)
+sma_alloc(struct stevedore *st, size_t size, int isobj)
 {
 	struct sma *sma;
 
+	(void)isobj;
 	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-09-30 08:40:01 UTC (rev 4265)
+++ trunk/varnish-cache/bin/varnishd/storage_persistent.c	2009-10-01 08:58:05 UTC (rev 4266)
@@ -1220,13 +1220,14 @@
  */
 
 static struct storage *
-smp_alloc(struct stevedore *st, size_t size)
+smp_alloc(struct stevedore *st, size_t size, int isobj)
 {
 	struct smp_sc *sc;
 	struct storage *ss;
 	struct smp_seg *sg;
 	size_t sz2;
 
+	(void)isobj;
 	CAST_OBJ_NOTNULL(sc, st->priv, SMP_SC_MAGIC);
 
 	Lck_Lock(&sc->mtx);



More information about the varnish-commit mailing list