r4961 - trunk/varnish-cache/bin/varnishd

phk at varnish-cache.org phk at varnish-cache.org
Wed Jun 16 12:39:33 CEST 2010


Author: phk
Date: 2010-06-16 12:39:33 +0200 (Wed, 16 Jun 2010)
New Revision: 4961

Modified:
   trunk/varnish-cache/bin/varnishd/stevedore.c
   trunk/varnish-cache/bin/varnishd/stevedore.h
   trunk/varnish-cache/bin/varnishd/storage_malloc.c
   trunk/varnish-cache/bin/varnishd/varnishd.c
Log:
Move SMA stats allocation to child process



Modified: trunk/varnish-cache/bin/varnishd/stevedore.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.c	2010-06-16 10:39:09 UTC (rev 4960)
+++ trunk/varnish-cache/bin/varnishd/stevedore.c	2010-06-16 10:39:33 UTC (rev 4961)
@@ -215,18 +215,6 @@
 }
 
 void
-STV_ready(void)
-{
-	struct stevedore *stv;
-
-	ASSERT_MGT();
-	VTAILQ_FOREACH(stv, &stevedores, list) {
-		if (stv->ready != NULL)
-			stv->ready(stv);
-	}
-}
-
-void
 STV_open(void)
 {
 	struct stevedore *stv;

Modified: trunk/varnish-cache/bin/varnishd/stevedore.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.h	2010-06-16 10:39:09 UTC (rev 4960)
+++ trunk/varnish-cache/bin/varnishd/stevedore.h	2010-06-16 10:39:33 UTC (rev 4961)
@@ -36,7 +36,6 @@
 struct objcore;
 
 typedef void storage_init_f(struct stevedore *, int ac, char * const *av);
-typedef void storage_ready_f(struct stevedore *);
 typedef void storage_open_f(const struct stevedore *);
 typedef struct storage *storage_alloc_f(struct stevedore *, size_t size,
     struct objcore *);
@@ -51,7 +50,6 @@
 #define STEVEDORE_MAGIC		0x4baf43db
 	const char		*name;
 	storage_init_f		*init;		/* called by mgt process */
-	storage_ready_f		*ready;		/* called by mgt process */
 	storage_open_f		*open;		/* called by cache process */
 	storage_alloc_f		*alloc;		/* --//-- */
 	storage_trim_f		*trim;		/* --//-- */
@@ -73,7 +71,6 @@
 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_ready(void);
 void STV_open(void);
 void STV_close(void);
 void STV_config(const char *spec);

Modified: trunk/varnish-cache/bin/varnishd/storage_malloc.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_malloc.c	2010-06-16 10:39:09 UTC (rev 4960)
+++ trunk/varnish-cache/bin/varnishd/storage_malloc.c	2010-06-16 10:39:33 UTC (rev 4961)
@@ -182,30 +182,21 @@
 }
 
 static void
-sma_ready(struct stevedore *st)
+sma_open(const struct stevedore *st)
 {
 	struct sma_sc *sma_sc;
 
 	CAST_OBJ_NOTNULL(sma_sc, st->priv, SMA_SC_MAGIC);
+	Lck_New(&sma_sc->sma_mtx);
 	sma_sc->stats = VSM_Alloc(sizeof *sma_sc->stats,
 	    VSC_CLASS, VSC_TYPE_SMA, st->ident);
 	memset(sma_sc->stats, 0, sizeof *sma_sc->stats);
 }
 
-static void
-sma_open(const struct stevedore *st)
-{
-	struct sma_sc *sma_sc;
-
-	CAST_OBJ_NOTNULL(sma_sc, st->priv, SMA_SC_MAGIC);
-	Lck_New(&sma_sc->sma_mtx);
-}
-
 const struct stevedore sma_stevedore = {
 	.magic	=	STEVEDORE_MAGIC,
 	.name	=	"malloc",
 	.init	=	sma_init,
-	.ready	=	sma_ready,
 	.open	=	sma_open,
 	.alloc	=	sma_alloc,
 	.free	=	sma_free,

Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c	2010-06-16 10:39:09 UTC (rev 4960)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c	2010-06-16 10:39:33 UTC (rev 4961)
@@ -631,8 +631,6 @@
 	if (T_arg != NULL)
 		mgt_cli_telnet(T_arg);
 
-	STV_ready();	/* Complete initialization */
-
 	MGT_Run();
 
 	if (pfh != NULL)




More information about the varnish-commit mailing list