diff options
| author | chrislu <chris.lu@gmail.com> | 2022-02-14 01:36:10 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-02-14 01:36:10 -0800 |
| commit | fe57a2e770bf666ffb6f901631a7407a593225de (patch) | |
| tree | f9a8860adcfae81715ed86b9516bbe4392524219 /weed/mount/filehandle_map.go | |
| parent | dbeeda812376eda39997cd814c3e7eefaf4ea686 (diff) | |
| download | seaweedfs-fe57a2e770bf666ffb6f901631a7407a593225de.tar.xz seaweedfs-fe57a2e770bf666ffb6f901631a7407a593225de.zip | |
file set attribute
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() |
