Commit 93ed4729 authored by Aaron Jacobs's avatar Aaron Jacobs

Implemented memDir.LookUpInode.

parent a2c55f32
...@@ -50,4 +50,17 @@ func (d *memDir) checkInvariants() { ...@@ -50,4 +50,17 @@ func (d *memDir) checkInvariants() {
// Find the inode ID of the child with the given name. // Find the inode ID of the child with the given name.
// //
// LOCKS_EXCLUDED(d.mu) // LOCKS_EXCLUDED(d.mu)
func (d *memDir) LookUpInode(name string) (id fuse.InodeID, ok bool) func (d *memDir) LookUpInode(name string) (id fuse.InodeID, ok bool) {
d.mu.RLock()
defer d.mu.RUnlock()
for _, e := range d.entries {
if e.Name == name {
ok = true
id = e.Inode
return
}
}
return
}
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