Commit a5304b31 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b459a4b2
......@@ -590,7 +590,7 @@ type WatchLink struct {
// was queried also send pins.
//
// XXX locking?
fileTab map[zodb.Oid]*Watch // {} foid -> Watch
byfile map[zodb.Oid]*Watch // {} foid -> Watch
// IO
reqNext uint64 // stream ID for next wcfs-originated request
......@@ -1354,7 +1354,7 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
// XXX at = zobd.InvalidTid - remove watch
// XXX if watch was already established - we need to update it
w := wlink.fileTab[foid]
w := wlink.byfile[foid]
if w != nil {
panic("TODO") // XXX update the watch
}
......@@ -1419,6 +1419,9 @@ func (wlink *WatchLink) setupWatch(ctx context.Context, foid zodb.Oid, at zodb.T
return err
}
// XXX locking
wlink.byfile[foid] = w
return nil
}
......@@ -1428,11 +1431,11 @@ func (wnode *WatchNode) Open(flags uint32, fctx *fuse.Context) (nodefs.File, fus
head := wnode.head
wlink := &WatchLink{
sk: NewFileSock(),
id: atomic.AddInt32(&wnode.idNext, +1),
head: head,
fileTab: make(map[zodb.Oid]*Watch),
rxTab: make(map[uint64]chan string),
sk: NewFileSock(),
id: atomic.AddInt32(&wnode.idNext, +1),
head: head,
byfile: make(map[zodb.Oid]*Watch),
rxTab: make(map[uint64]chan string),
}
// 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