Commit 1be9d68a authored by Cecilie Fritzvold's avatar Cecilie Fritzvold

Move all use of the stevedore list to stevedore.c


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1730 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 0046bbd4
......@@ -216,13 +216,6 @@ struct storage {
#include "stevedore.h"
/*
* XXX: in the longer term, we want to support multiple stevedores,
* XXX: selected by some kind of heuristics based on size, lifetime
* XXX: etc etc. For now we support only one.
*/
extern struct stevedore_head *stevedore_h;
/* -------------------------------------------------------------------*/
struct object {
......
......@@ -38,7 +38,6 @@
#include "shmlog.h"
#include "cache.h"
struct stevedore_head *stevedore_h;
/*--------------------------------------------------------------------
* XXX: Think more about which order we start things
......@@ -47,8 +46,6 @@ struct stevedore_head *stevedore_h;
void
child_main(void)
{
struct stevedore *st;
setbuf(stdout, NULL);
setbuf(stderr, NULL);
printf("Child starts\n");
......@@ -67,12 +64,8 @@ child_main(void)
HSH_Init();
BAN_Init();
stevedore_h = &heritage.stevedore_h;
TAILQ_FOREACH(st, stevedore_h, stevedore_list) {
if (st->open != NULL)
st->open(st);
}
STV_open();
printf("Ready\n");
VSL_stats->start_time = (time_t)TIM_real();
......
......@@ -44,6 +44,7 @@ STV_alloc(size_t size)
{
struct storage *st;
struct stevedore *stv, *stv_first;
struct stevedore_head *stevedore_h = &heritage.stevedore_h;
/* Simple round robin selecting of a stevedore.
*/
......@@ -101,7 +102,6 @@ cmp_storage(struct stevedore *s, const char *p, const char *q)
return (0);
}
void
STV_add(const char *spec)
{
......@@ -131,3 +131,16 @@ STV_add(const char *spec)
if (stp->init != NULL)
stp->init(stp, q);
}
void
STV_open(void)
{
struct stevedore_head *stevedore_h;
struct stevedore *st;
stevedore_h = &heritage.stevedore_h;
TAILQ_FOREACH(st, stevedore_h, stevedore_list) {
if (st->open != NULL)
st->open(st);
}
}
......@@ -59,3 +59,4 @@ struct storage *STV_alloc(size_t size);
void STV_trim(struct storage *st, size_t size);
void STV_free(struct storage *st);
void STV_add(const char *spec);
void STV_open(void);
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