Commit cb68d31a authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse/nodefs: reduce critical section for memnode.

parent f498bfe0
......@@ -47,16 +47,17 @@ func (fs *memNodeFs) OnUnmount() {
func (fs *memNodeFs) newNode() *memNode {
fs.mutex.Lock()
id := fs.nextFree
fs.nextFree++
fs.mutex.Unlock()
n := &memNode{
Node: NewDefaultNode(),
fs: fs,
id: fs.nextFree,
id: id,
}
now := time.Now()
n.info.SetTimes(&now, &now, &now)
n.info.Mode = fuse.S_IFDIR | 0777
fs.nextFree++
fs.mutex.Unlock()
return n
}
......
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