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

@@ -145,9 +145,15 @@ func (wfs *WFS) Rename(cancel <-chan struct{}, in *fuse.RenameIn, oldName string
return fuse.EINVAL
}
oldDir := wfs.inodeToPath.GetPath(in.NodeId)
oldDir, code := wfs.inodeToPath.GetPath(in.NodeId)
if code != fuse.OK {
return
}
oldPath := oldDir.Child(oldName)
newDir := wfs.inodeToPath.GetPath(in.Newdir)
newDir, code := wfs.inodeToPath.GetPath(in.Newdir)
if code != fuse.OK {
return
}
newPath := newDir.Child(newName)
glog.V(4).Infof("dir Rename %s => %s", oldPath, newPath)