Commit a5304b31 authored by Kirill Smelkov's avatar Kirill Smelkov

.

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