Commit 1a30dde3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Give the persistent watcher-thread something to do

parent 2b2f723e
......@@ -309,8 +309,16 @@ smp_thread(struct sess *sp, void *priv)
BAN_Deref(&sc->tailban);
sc->tailban = NULL;
printf("Silo completely loaded\n");
while (1)
while (1) {
(void)sleep (1);
sg = VTAILQ_FIRST(&sc->segments);
if (sg != NULL && sg -> sc->cur_seg &&
sg->nobj == 0) {
Lck_Lock(&sc->mtx);
smp_save_segs(sc);
Lck_Unlock(&sc->mtx);
}
}
NEEDLESS_RETURN(NULL);
}
......
......@@ -185,6 +185,7 @@ void smp_load_seg(const struct sess *sp, const struct smp_sc *sc,
void smp_new_seg(struct smp_sc *sc);
void smp_close_seg(struct smp_sc *sc, struct smp_seg *sg);
void smp_init_oc(struct objcore *oc, struct smp_seg *sg, unsigned objidx);
void smp_save_segs(struct smp_sc *sc);
/* storage_persistent_subr.c */
......
......@@ -83,7 +83,7 @@ smp_save_seg(const struct smp_sc *sc, struct smp_signctx *ctx)
smp_sync_sign(ctx);
}
static void
void
smp_save_segs(struct smp_sc *sc)
{
struct smp_seg *sg, *sg2;
......
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