return fuse.Status when looking up by inode

This commit is contained in:
chrislu
2022-02-18 00:45:43 -08:00
parent b9cf4f12fc
commit f9d33f70b0
10 changed files with 59 additions and 17 deletions

View File

@@ -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 {