Commit 0a37ff0d authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse/nodefs: fix comment for LookupNode.

parent fab46421
...@@ -227,18 +227,18 @@ func (c *FileSystemConnector) Node(parent *Inode, fullPath string) (*Inode, []st ...@@ -227,18 +227,18 @@ func (c *FileSystemConnector) Node(parent *Inode, fullPath string) (*Inode, []st
return node, nil return node, nil
} }
// Follows the path from the given parent. The path should be '/' // Follows the path from the given parent, doing lookups as
// separated without leading slash. // necesary. The path should be '/' separated without leading slash.
func (c *FileSystemConnector) LookupNode(parent *Inode, path string) *Inode { func (c *FileSystemConnector) LookupNode(parent *Inode, path string) *Inode {
// TODO - this is broken. The internalLookups will cause
// Nlookup increments that the kernel does not know about.
if path == "" { if path == "" {
return parent return parent
} }
components := strings.Split(path, "/") components := strings.Split(path, "/")
for _, r := range components { for _, r := range components {
var a fuse.Attr var a fuse.Attr
// This will not affect inode ID lookup counts, which
// are only update in response to kernel requests.
child, _ := c.internalLookup(&a, parent, r, nil) child, _ := c.internalLookup(&a, parent, r, nil)
if child == nil { if child == nil {
return nil return nil
......
...@@ -122,7 +122,7 @@ func (fs *PathNodeFs) Node(name string) *nodefs.Inode { ...@@ -122,7 +122,7 @@ func (fs *PathNodeFs) Node(name string) *nodefs.Inode {
return n return n
} }
// Like node, but use Lookup to discover inodes we may not have yet. // Like Node, but use Lookup to discover inodes we may not have yet.
func (fs *PathNodeFs) LookupNode(name string) *nodefs.Inode { func (fs *PathNodeFs) LookupNode(name string) *nodefs.Inode {
return fs.connector.LookupNode(fs.Root().Inode(), name) return fs.connector.LookupNode(fs.Root().Inode(), name)
} }
......
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