Commit 50607488 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make the sma and smf locks dynamic.

parent 5cc2036a
......@@ -63,6 +63,8 @@
*/
#define NBUCKET (128 / 4 + 1)
static struct VSC_C_lck *lck_smf;
/*--------------------------------------------------------------------*/
VTAILQ_HEAD(smfhead, smf);
......@@ -420,6 +422,9 @@ smf_open(const struct stevedore *st)
off_t fail = 1 << 30; /* XXX: where is OFF_T_MAX ? */
off_t sum = 0;
ASSERT_CLI();
if (lck_smf == NULL)
lck_smf = Lck_CreateClass("smf");
CAST_OBJ_NOTNULL(sc, st->priv, SMF_SC_MAGIC);
sc->stats = VSM_Alloc(sizeof *sc->stats,
VSC_CLASS, VSC_type_smf, st->ident);
......
......@@ -57,6 +57,8 @@ struct sma {
struct sma_sc *sc;
};
static struct VSC_C_lck *lck_sma;
static struct storage *
sma_alloc(const struct stevedore *st, size_t size)
{
......@@ -235,6 +237,9 @@ sma_open(const struct stevedore *st)
{
struct sma_sc *sma_sc;
ASSERT_CLI();
if (lck_sma == NULL)
lck_sma = Lck_CreateClass("sma");
CAST_OBJ_NOTNULL(sma_sc, st->priv, SMA_SC_MAGIC);
Lck_New(&sma_sc->sma_mtx, lck_sma);
sma_sc->stats = VSM_Alloc(sizeof *sma_sc->stats,
......
......@@ -40,8 +40,6 @@ LOCK(mempool)
LOCK(objhdr)
LOCK(pipestat)
LOCK(sess)
LOCK(sma)
LOCK(smf)
LOCK(vbe)
LOCK(vcapace)
LOCK(vcl)
......
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