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

@@ -18,7 +18,10 @@ func (wfs *WFS) Symlink(cancel <-chan struct{}, header *fuse.InHeader, target st
return s
}
dirPath := wfs.inodeToPath.GetPath(header.NodeId)
dirPath, code := wfs.inodeToPath.GetPath(header.NodeId)
if code != fuse.OK {
return
}
entryFullPath := dirPath.Child(name)
request := &filer_pb.CreateEntryRequest{
@@ -64,7 +67,10 @@ func (wfs *WFS) Symlink(cancel <-chan struct{}, header *fuse.InHeader, target st
}
func (wfs *WFS) Readlink(cancel <-chan struct{}, header *fuse.InHeader) (out []byte, code fuse.Status) {
entryFullPath := wfs.inodeToPath.GetPath(header.NodeId)
entryFullPath, code := wfs.inodeToPath.GetPath(header.NodeId)
if code != fuse.OK {
return
}
entry, status := wfs.maybeLoadEntry(entryFullPath)
if status != fuse.OK {