Commit 6559cefe authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 1a587945
......@@ -472,10 +472,8 @@ type Head struct {
// XXX move zconn's current transaction to Head here?
// XXX move watchTab here?
// head/watch opens
// XXX protected by ... head.zconnMu ?
// XXX -> Head ?
watchTab map[*Watcher]struct{}
}
......@@ -489,11 +487,10 @@ type Watch struct {
// /head/watch handle - served by Watcher.
type Watcher struct {
sk *FileSock
sk *FileSock // IO channel to client
id int32 // ID of this /head/watch handle (for debug log)
head *Head
// established file watchers.
// XXX in-progress - where?
// XXX locking?
......@@ -1251,16 +1248,18 @@ retry:
// Open serves /head/watch opens.
func (watch *Watch) Open(flags uint32, fctx *fuse.Context) (nodefs.File, fuse.Status) {
// XXX check flags?
head := watch.head
w := &Watcher{
sk: NewFileSock(),
id: atomic.AddInt32(&watch.idNext, +1),
head: watch.head,
head: head,
fileTab: make(map[*FileWatch]struct{}),
}
// XXX locking
// XXX del watchTab[w] on w.sk.File.Release
watch.head.watchTab[w] = struct{}{}
head.watchTab[w] = struct{}{}
go w.serve()
return w.sk.File(), fuse.OK
......
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