Commit 424beee4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 501b7b27
......@@ -499,8 +499,8 @@ type BigFile struct {
// things read/computed from .zbf; constant during lifetime of current transaction.
blksize int64 // zbf.blksize
zbfSize int64 // zbf.Size() XXX -> .size
rev zodb.Tid // last revision that modified file data
size int64 // zbf.Size()
rev zodb.Tid // last revision that modified zbf data
// tail change history of this file.
δFtail *ΔTailI64 // [](rev↑, []#blk)
......@@ -802,12 +802,12 @@ retry:
// XXX -> parallel?
// XXX locking
for file := range toinvalidate {
zbfSize, treePath, err := file.zbf.Size(ctx)
size, treePath, err := file.zbf.Size(ctx)
if err != nil {
panic(err) // XXX
}
file.zbfSize = zbfSize
file.size = size
bfdir.indexLooked.Add(file, treePath)
file.rev = zhead.At()
......@@ -1141,7 +1141,7 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
rev := zbf.PSerial()
zbf.PDeactivate()
zbfSize, treePath, err := zbf.Size(ctx)
size, treePath, err := zbf.Size(ctx)
if err != nil {
return nil, err
}
......@@ -1152,7 +1152,7 @@ func (head *Head) bigopen(ctx context.Context, oid zodb.Oid) (_ *BigFile, err er
head: head,
zbf: zbf,
blksize: blksize,
zbfSize: zbfSize,
size: size,
rev: rev,
// XXX this is needed only for head/
......@@ -1208,7 +1208,7 @@ func (f *BigFile) GetAttr(out *fuse.Attr, _ nodefs.File, _ *fuse.Context) fuse.S
func (f *BigFile) getattr(out *fuse.Attr) {
out.Mode = fuse.S_IFREG | 0444
out.Size = uint64(f.zbfSize)
out.Size = uint64(f.size)
// .Blocks
// .Blksize
......@@ -1224,8 +1224,8 @@ func (f *BigFile) Read(_ nodefs.File, dest []byte, off int64, fctx *fuse.Context
// cap read request to file size
end := off + int64(len(dest)) // XXX overflow?
if end > f.zbfSize {
end = f.zbfSize
if end > f.size {
end = f.size
}
if end <= off {
// XXX off >= size -> EINVAL? (but when size=0 kernel issues e.g. [0 +4K) read)
......
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