Commit f4f0fa33 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Lasse Karstensen

Make the sma and smf locks dynamic.

Conflicts:
	include/tbl/locks.h

Merge note: Keeping persistence locks are they were, due to non-merged SML reorganisation.
parent 33c2ac25
......@@ -62,6 +62,8 @@
*/
#define NBUCKET (128 / 4 + 1)
static struct VSC_C_lck *lck_smf;
/*--------------------------------------------------------------------*/
VTAILQ_HEAD(smfhead, smf);
......@@ -419,6 +421,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);
......
......@@ -56,6 +56,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)
{
......@@ -234,6 +236,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(smp)
LOCK(vbe)
LOCK(vcapace)
......
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