diff options
Diffstat (limited to 'weed/mount/inode_to_path.go')
| -rw-r--r-- | weed/mount/inode_to_path.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.go index 04366ab0d..e3fabb422 100644 --- a/weed/mount/inode_to_path.go +++ b/weed/mount/inode_to_path.go @@ -59,3 +59,13 @@ func (i *InodeToPath) HasPath(path util.FullPath) bool { _, found := i.path2inode[path] return found } + +func (i *InodeToPath) HasInode(inode uint64) bool { + if inode == 1 { + return true + } + i.RLock() + defer i.RUnlock() + _, found := i.inode2path[inode] + return found +} |
