aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/inode_to_path.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-02-18 00:45:43 -0800
committerchrislu <chris.lu@gmail.com>2022-02-18 00:45:43 -0800
commitf9d33f70b0529451c583c2fe41685fbe4234069e (patch)
treeaadf1c22f63603e2ff224c150aeac668409bd37a /weed/mount/inode_to_path.go
parentb9cf4f12fcab2c0fdd35af256faa28f53a414dc2 (diff)
downloadseaweedfs-f9d33f70b0529451c583c2fe41685fbe4234069e.tar.xz
seaweedfs-f9d33f70b0529451c583c2fe41685fbe4234069e.zip
return fuse.Status when looking up by inode
Diffstat (limited to 'weed/mount/inode_to_path.go')
-rw-r--r--weed/mount/inode_to_path.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.go
index edea91a5d..ae95730e1 100644
--- a/weed/mount/inode_to_path.go
+++ b/weed/mount/inode_to_path.go
@@ -3,6 +3,7 @@ package mount
import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/util"
+ "github.com/hanwen/go-fuse/v2/fuse"
"sync"
)
@@ -65,14 +66,14 @@ func (i *InodeToPath) GetInode(path util.FullPath) uint64 {
return inode
}
-func (i *InodeToPath) GetPath(inode uint64) util.FullPath {
+func (i *InodeToPath) GetPath(inode uint64) (util.FullPath, fuse.Status) {
i.RLock()
defer i.RUnlock()
path, found := i.inode2path[inode]
if !found {
- glog.Fatalf("not found inode %d", inode)
+ return "", fuse.ENOENT
}
- return path.FullPath
+ return path.FullPath, fuse.OK
}
func (i *InodeToPath) HasPath(path util.FullPath) bool {