Commit 4795d8d5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cda8c398
......@@ -302,13 +302,11 @@ func (δFtail *ΔFtail) Track(file *ZBigFile, blk int64, path []btree.LONode, bl
}
}
// rebuild1IfNeeded rebuilds vδE for a file if there is such need.
// vδEForFile returns vδE and current root for specified file.
//
// It also returns corresponding δftail.root for convenience.
// the only case when vδE actually needs to be rebuilt is when the file just started to be tracked.
//
// XXX naming -> vδEForFile ? vδEBuildIfNeeded?
func (δFtail *ΔFtail) rebuild1IfNeeded(foid zodb.Oid) (vδE []_ΔFileEpoch, headRoot zodb.Oid, err error) {
// It builds vδE for that file if there is such need.
// The only case when vδE actually needs to be built is when the file just started to be tracked.
func (δFtail *ΔFtail) vδEForFile(foid zodb.Oid) (vδE []_ΔFileEpoch, headRoot zodb.Oid, err error) {
δFtail.mu.Lock() // TODO verify that there is no in-progress writers
defer δFtail.mu.Unlock()
......@@ -661,7 +659,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
// δFile ────────o───────o──────x─────x────────────────────────
vδE, headRoot, err := δFtail.rebuild1IfNeeded(foid)
vδE, headRoot, err := δFtail.vδEForFile(foid)
if err != nil {
panic(err) // XXX
}
......@@ -981,7 +979,7 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
panicf("zconn.at out of bounds: zconn.at: @%s, (tail, head] = (@%s, @%s]", zconnAt, tail, head)
}
vδE, headRoot, err := δFtail.rebuild1IfNeeded(foid)
vδE, headRoot, err := δFtail.vδEForFile(foid)
if err != nil {
return zodb.InvalidTid, false, err
}
......
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