diff options
Diffstat (limited to 'weed/mount/filehandle_map.go')
| -rw-r--r-- | weed/mount/filehandle_map.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/weed/mount/filehandle_map.go b/weed/mount/filehandle_map.go index 50ca6bcea..80cfd02c7 100644 --- a/weed/mount/filehandle_map.go +++ b/weed/mount/filehandle_map.go @@ -30,6 +30,13 @@ func (i *FileHandleToInode) GetFileHandle(fh FileHandleId) *FileHandle { return nil } +func (i *FileHandleToInode) FindFileHandle(inode uint64) (fh *FileHandle, found bool) { + i.RLock() + defer i.RUnlock() + fh, found = i.inode2fh[inode] + return +} + func (i *FileHandleToInode) AcquireFileHandle(wfs *WFS, inode uint64, entry *filer_pb.Entry) *FileHandle { i.Lock() defer i.Unlock() |
