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

Remove incorrect use of generation in FileSystemConnector

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