Commit 9877c0d5 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Move SMA stats allocation to child process



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4961 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 5d8f2601
......@@ -214,18 +214,6 @@ STV_free(struct storage *st)
st->stevedore->free(st);
}
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)
{
......
......@@ -36,7 +36,6 @@ struct object;
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 @@ struct stevedore {
#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 object *STV_NewObject(struct sess *sp, unsigned len, double ttl,
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);
......
......@@ -182,30 +182,21 @@ sma_init(struct stevedore *parent, int ac, char * const *av)
}
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,
......
......@@ -631,8 +631,6 @@ main(int argc, char * const *argv)
if (T_arg != NULL)
mgt_cli_telnet(T_arg);
STV_ready(); /* Complete initialization */
MGT_Run();
if (pfh != NULL)
......
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