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

.

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