Restored lost code.

geesefs-0-30-9
Aaron Jacobs 2015-05-19 15:52:28 +10:00
parent fe7d0eab90
commit 6f8dbe44b0
1 changed files with 20 additions and 0 deletions

View File

@ -168,6 +168,26 @@ func (in *inode) isFile() bool {
return !(in.isDir() || in.isSymlink())
}
// Return the index of the child within in.entries, if it exists.
//
// REQUIRES: in.dir
// LOCKS_REQUIRED(in.mu)
func (in *inode) findChild(name string) (i int, ok bool) {
if !in.isDir() {
panic("findChild called on non-directory.")
}
var e fuseutil.Dirent
for i, e = range in.entries {
if e.Name == name {
ok = true
return
}
}
return
}
////////////////////////////////////////////////////////////////////////
// Public methods
////////////////////////////////////////////////////////////////////////