Commit 124708c4 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Save one lookup for Mount().

parent 9f36c953
...@@ -44,7 +44,6 @@ type inode struct { ...@@ -44,7 +44,6 @@ type inode struct {
Name string Name string
LookupCount int LookupCount int
OpenCount int OpenCount int
mount *mountData mount *mountData
} }
...@@ -394,7 +393,6 @@ func EmptyFileSystemConnector() (out *FileSystemConnector) { ...@@ -394,7 +393,6 @@ func EmptyFileSystemConnector() (out *FileSystemConnector) {
return out return out
} }
func (me *FileSystemConnector) Mount(mountPoint string, fs FileSystem) Status { func (me *FileSystemConnector) Mount(mountPoint string, fs FileSystem) Status {
var node *inode var node *inode
...@@ -403,10 +401,11 @@ func (me *FileSystemConnector) Mount(mountPoint string, fs FileSystem) Status { ...@@ -403,10 +401,11 @@ func (me *FileSystemConnector) Mount(mountPoint string, fs FileSystem) Status {
dirParentNode := me.findInode(dirParent) dirParentNode := me.findInode(dirParent)
// Make sure we know the mount point. // Make sure we know the mount point.
_, _ = me.internalLookup(dirParentNode, base, 0) _, _, node = me.internalLookupWithNode(dirParentNode, base, 0)
} else {
node = me.rootNode
} }
node = me.findInode(mountPoint)
if !node.IsDir() { if !node.IsDir() {
return EINVAL return EINVAL
} }
......
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