Commit a97d8c11 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 19738029
......@@ -533,12 +533,22 @@ func (r *Root) zwatcher(ctx context.Context) (err error) {
defer xerr.Contextf(&err, "zwatch") // XXX more in context?
// XXX unmount on error? -> always EIO?
zwatch := r.zstor.Watch() // XXX -> create before zwatcher is started
zwatchq := make(chan zodb.WatchEvent)
r.zstor.AddWatch(zwatchq)
defer r.zstor.DelWatch(zwatchq)
var zevent zodb.WatchEvent
var ok bool
for {
zevent, err := zwatch.Read(ctx)
if err != nil {
return err
select {
case <-ctx.Done():
return ctx.Err()
case zevent, ok = <-zwatchq:
if !ok {
return nil // closed XXX ok?
}
}
r.zhandle1(zevent)
......@@ -642,6 +652,9 @@ func (f *BigFile) invalidateBlk(ctx context.Context, blk int64) error {
// store retrieved data back to OS cache for file @<rev>/file[blk]
blkrev, _ := f.δFtail.LastRevOf(blk, f.head.zconn.At())
frev, err := groot.mkrevfile(blkrev, f.zbf.POid())
if err != nil {
// XXX
}
st = fsconn.FileNotifyStoreCache(frev.Inode(), off, blkdata)
if st != fuse.OK {
// XXX log - dup wrt readBlk -> common func.
......@@ -689,7 +702,7 @@ func (root *Root) mkrevfile(rev zodb.Tid, fid zodb.Oid) (_ *BigFile, err error)
defer f.Close()
xfrev = fsconn.LookupNode(root.Inode(), frevpath)
// must be !nil as open succeeded
// must be !nil as open succeeded XXX better recheck
return xfrev.Node().(*BigFile), nil
}
......
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