Commit 1afe0292 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 947e04cb
......@@ -617,7 +617,8 @@ func (r *Root) zhandle1(zevent zodb.WatchEvent) {
r.zheadMu.Lock()
defer r.zheadMu.Unlock()
toinvalidate := map[*ZBigFile]SetI64{} // {} zfile -> set(#blk)
//toinvalidate := map[*ZBigFile]SetI64{} // {} zfile -> set(#blk)
toinvalidate := map[*BigFileData]SetI64{} // {} zfile -> set(#blk)
// zevent = (tid^, []oid)
for _, oid := range zevent.Changev {
......@@ -656,9 +657,10 @@ func (r *Root) zhandle1(zevent zodb.WatchEvent) {
}
//wg = ...
ctx := context.TODO()
for file, blkmap := range toinvalidate {
for blk := range blkmap {
go file.invalidateBlk(blk) // XXX -> wg.Go
go file.invalidateBlk(ctx, blk) // XXX -> wg.Go
}
}
......@@ -667,7 +669,7 @@ func (r *Root) zhandle1(zevent zodb.WatchEvent) {
// invalidateBlk invalidates 1 file block. XXX
// XXX see "4.4) for all file/blk to in invalidate we do"
func (f *file) invalidateBlk(ctx context.Context, blk int64) error {
func (f *BigFileData) invalidateBlk(ctx context.Context, blk int64) error {
fsconn := f.root().fsconn
off := blk*blksize
......@@ -683,7 +685,7 @@ func (f *file) invalidateBlk(ctx context.Context, blk int64) error {
if len(blkdata) == blksize {
// XXX -> go
// store retrieved data back to OS cache for file @<rev>/data[blk]
frev, _ := file.δFtail.LastRevOf(blk, at)
frev, _ := f.bigfile.δFtail.LastRevOf(blk, at)
st = fsconn.FileNotifyStoreCache(frev.Inode(), off, blkdata)
if st != fuse.OK {
// XXX log - dup wrt readBlk -> common func.
......
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