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

Add context argument to FsNode.Lookup.

parent ffe787c4
......@@ -33,7 +33,7 @@ type FsNode interface {
RmChild(name string, child FsNode)
AddChild(name string, child FsNode)
Lookup(name string) (fi *os.FileInfo, node FsNode, code Status)
Lookup(name string, context *Context) (fi *os.FileInfo, node FsNode, code Status)
OnForget()
// Misc.
......
......@@ -49,7 +49,7 @@ func (me *DefaultFsNode) RmChild(name string, child FsNode) {
func (me *DefaultFsNode) AddChild(name string, child FsNode) {
}
func (me *DefaultFsNode) Lookup(name string) (fi *os.FileInfo, node FsNode, code Status) {
func (me *DefaultFsNode) Lookup(name string, context *Context) (fi *os.FileInfo, node FsNode, code Status) {
return nil, nil, ENOSYS
}
......
......@@ -54,7 +54,7 @@ func (me *FileSystemConnector) internalLookup(parent *Inode, name string, contex
if getattrNode != nil {
fi, code = getattrNode.fsInode.GetAttr(nil, nil)
} else if lookupNode != nil {
fi, fsNode, code = parent.fsInode.Lookup(name)
fi, fsNode, code = parent.fsInode.Lookup(name, context)
}
return me.postLookup(fi, fsNode, code, getattrNode, lookupNode, name)
......
......@@ -344,10 +344,9 @@ func (me *pathInode) Open(flags uint32, context *Context) (file File, code Statu
return me.fs.Open(me.GetPath(), flags, context)
}
// TOOD - need context.
func (me *pathInode) Lookup(name string) (fi *os.FileInfo, node FsNode, code Status) {
func (me *pathInode) Lookup(name string, context *Context) (fi *os.FileInfo, node FsNode, code Status) {
fullPath := filepath.Join(me.GetPath(), name)
fi, code = me.fs.GetAttr(fullPath, nil)
fi, code = me.fs.GetAttr(fullPath, context)
if code.Ok() {
node = me.findChild(fi.Ino, name)
}
......
......@@ -63,7 +63,7 @@ func (me *memNode) Print(indent int) {
}
// We construct the tree at mount, so we never need to look anything up.
func (me *memNode) Lookup(name string) (fi *os.FileInfo, node fuse.FsNode, code fuse.Status) {
func (me *memNode) Lookup(name string, c *fuse.Context) (fi *os.FileInfo, node fuse.FsNode, code fuse.Status) {
return nil, nil, fuse.ENOENT
}
......
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