Commit 3d0b0a68 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 0a94ba43
......@@ -522,6 +522,9 @@ type BigFile struct {
// zbf.Size(). It is constant during liftime of current transaction.
zbfSize int64
// change history of this file.
δFtail *ΔTailI64 // [](rev, []#blk)
// TODO -> δFtail
// lastChange zodb.Tid // last change to whole bigfile as of .zconn.At view
}
......@@ -839,6 +842,9 @@ func bigopen(ctx context.Context, zconn *ZConn, oid zodb.Oid) (_ *BigFile, err e
zconn: zconn,
zbf: zbf,
zbfSize: zbfSize,
// XXX this is needed only for head/
δFtail: NewΔTailI64(), // XXX indicate we have coverage starting from zconn.at?
}, nil
}
......@@ -933,6 +939,7 @@ func (bfdata *BigFileData) Read(_ nodefs.File, dest []byte, off int64, fctx *fus
// len(dest) == blksize.
func (bfdata *BigFileData) readBlk(ctx context.Context, blk int64, dest []byte) error {
// XXX errctx?
// XXX locking
// check if someone else is already loading this block
bfdata.loadMu.Lock()
......@@ -968,11 +975,12 @@ func (bfdata *BigFileData) readBlk(ctx context.Context, blk int64, dest []byte)
close(loading.ready)
// XXX before loading.ready?
/*
blkrevmax2 := max(δFtail.by(blk)) || min(rev for rev in δFtail)
revmax = min(blkrevmax1, blkrevmax2)
blkrevmax2, _ := bfdata.bigfile.δFtail.LastRevOf(blk, zbf.PJar().At())
//revmax := min(blkrevmax1, blkrevmax2)
revmax := blkrevmax2
_ = revmax
/*
// XXX remmapping
// XXX -> own func?
// XXX locking
......
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