Commit 3c338fcb authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Martin Blix Grydeland

Properly count vsm segments and rebuild _.index when retired

segments dominate the _.index file.
parent d3be9d0e
......@@ -206,7 +206,6 @@ vsmw_append_record(struct vsmw *vsmw, struct vsmwseg *seg, char act)
s = write(fd, VSB_data(vsmw->vsb), VSB_len(vsmw->vsb));
assert(s == VSB_len(vsmw->vsb)); // XXX handle ENOSPC? #2764
AZ(close(fd));
vsmw->nsegs++;
}
/*--------------------------------------------------------------------*/
......@@ -238,7 +237,7 @@ vsmw_delseg(struct vsmw *vsmw, struct vsmwseg *seg, int fixidx)
VTAILQ_REMOVE(&vsmw->segs, seg, list);
vsmw->nsegs--;
if (vsmw->nsubs < vsmw->nsegs || !fixidx) {
if (vsmw->nsubs * 2 < vsmw->nsegs || !fixidx) {
vsmw_append_record(vsmw, seg, '-');
vsmw->nsubs++;
} else {
......
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