sml: Delay freeing of trimmed segments always

sml_trimstore() already delays freeing of a replaced last, smaller segment for
the reallocation case at the bottom of the function: Because a concurrently
running iterator might have already taken a reference on a to-be-replaced
segment, it can not be freed immediately, but rather is kept around until the
busy object is no more.

This trivial change applies the same also for a segment which turns out to be
unneeded because writing the object ended with a zero length in this segment.

Simple, but consequential, see next commit
parent ec46847a
......@@ -560,7 +560,8 @@ sml_trimstore(struct worker *wrk, struct objcore *oc)
Lck_Lock(&oc->boc->mtx);
VTAILQ_REMOVE(&o->list, st, list);
Lck_Unlock(&oc->boc->mtx);
sml_stv_free(stv, st);
/* sml_bocdone frees this */
oc->boc->stevedore_priv = st;
return;
}
......
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