Commit f0afdaf7 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 131662a9
......@@ -506,7 +506,7 @@ type Head struct {
inflightOSCacheUploads int32
// head/watch opens
// XXX protected by ... zheadMu ?
wlinkMu sync.Mutex
wlinkTab map[*WatchLink]struct{}
// waiters for zhead.At to become ≥ their at.
......@@ -1563,9 +1563,10 @@ func (wnode *WatchNode) Open(flags uint32, fctx *fuse.Context) (nodefs.File, fus
rxTab: make(map[uint64]chan string),
}
// XXX locking
head.wlinkMu.Lock()
// XXX del wlinkTab[w] on w.sk.File.Release
head.wlinkTab[wlink] = struct{}{}
head.wlinkMu.Unlock()
go wlink.serve()
return wlink.sk.File(), fuse.OK
......@@ -1579,9 +1580,13 @@ func (wlink *WatchLink) serve() {
if err != nil {
log.Error(err)
}
// XXX locking
delete(wlink.head.wlinkTab, wlink)
// XXX deactiwate all watches from wlink.byfile[*]
head := wlink.head
head.wlinkMu.Lock()
delete(head.wlinkTab, wlink)
head.wlinkMu.Unlock()
}
func (wlink *WatchLink) _serve() (err error) {
......
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