return fuse.Status when looking up by inode
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user