Implemented memDir.LookUpInode.

geesefs-0-30-9
Aaron Jacobs 2015-03-02 15:19:20 +11:00
parent a2c55f32d0
commit 93ed47299e
1 changed files with 14 additions and 1 deletions

View File

@ -50,4 +50,17 @@ func (d *memDir) checkInvariants() {
// Find the inode ID of the child with the given name.
//
// 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
}