MCPcopy
hub / github.com/rclone/rclone / Lookup

Method Lookup

cmd/mount2/node.go:191–205  ·  view source on GitHub ↗

Lookup should find a direct child of a directory by the child's name. If the entry does not exist, it should return ENOENT and optionally set a NegativeTimeout in `out`. If it does exist, it should return attribute data in `out` and return the Inode for the child. A new inode can be created using `

(ctx context.Context, name string, out *fuse.EntryOut)

Source from the content-addressed store, hash-verified

189// children in directories. Hence, they also return *Inode and must
190// populate their fuse.EntryOut arguments.
191func (n *Node) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (inode *fusefs.Inode, errno syscall.Errno) {
192 defer log.Trace(n, "name=%q", name)("inode=%v, attr=%v, errno=%v", &inode, &out, &errno)
193 vfsNode, errno := n.lookupVfsNodeInDir(name)
194 if errno != 0 {
195 return nil, errno
196 }
197 newNode := newNode(n.fsys, vfsNode)
198
199 // FIXME
200 // out.SetEntryTimeout(dt time.Duration)
201 // out.SetAttrTimeout(dt time.Duration)
202 n.fsys.setEntryOut(vfsNode, out)
203
204 return n.NewInode(ctx, newNode, fusefs.StableAttr{Mode: out.Attr.Mode}), 0
205}
206
207var _ = (fusefs.NodeLookuper)((*Node)(nil))
208

Callers

nothing calls this directly

Implementers 2

Filevfs/file.go
Dirvfs/dir.go

Calls 4

lookupVfsNodeInDirMethod · 0.95
TraceFunction · 0.92
newNodeFunction · 0.85
setEntryOutMethod · 0.80

Tested by

no test coverage detected