Commit 92a4cb63 authored by Frederick Akalin's avatar Frederick Akalin

Remove incorrect use of generation in FileSystemConnector

parent c4a6d9fd
......@@ -8,7 +8,6 @@ import (
"log"
"path/filepath"
"strings"
"sync/atomic"
"time"
"unsafe"
......@@ -22,10 +21,6 @@ var paranoia = false
// structs of uint32/uint64) to operations on Go objects representing
// files and directories.
type FileSystemConnector struct {
// Used as the generation inodes. This must be 64-bit aligned,
// for sync/atomic on i386 to work properly.
generation uint64
debug bool
// Callbacks for talking back to the kernel.
......@@ -59,9 +54,6 @@ func NewFileSystemConnector(root Node, opts *Options) (c *FileSystemConnector) {
c.inodeMap = newPortableHandleMap()
c.rootNode = newInode(true, root)
// Make sure we don't reuse generation numbers.
c.generation = uint64(time.Now().UnixNano())
c.verify()
c.mountRoot(opts)
......@@ -82,10 +74,6 @@ func (c *FileSystemConnector) SetDebug(debug bool) {
c.debug = debug
}
func (c *FileSystemConnector) nextGeneration() uint64 {
return atomic.AddUint64(&c.generation, 1)
}
// This verifies invariants of the data structure. This routine
// acquires tree locks as it walks the inode tree.
func (c *FileSystemConnector) verify() {
......
......@@ -117,7 +117,6 @@ func (n *Inode) IsDir() bool {
func (n *Inode) NewChild(name string, isDir bool, fsi Node) *Inode {
ch := newInode(isDir, fsi)
ch.mount = n.mount
n.generation = ch.mount.connector.nextGeneration()
n.AddChild(name, ch)
return ch
}
......
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