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

@@ -37,7 +37,10 @@ func (wfs *WFS) Mkdir(cancel <-chan struct{}, in *fuse.MkdirIn, name string, out
},
}
dirFullPath := wfs.inodeToPath.GetPath(in.NodeId)
dirFullPath, code := wfs.inodeToPath.GetPath(in.NodeId)
if code != fuse.OK {
return
}
entryFullPath := dirFullPath.Child(name)
@@ -89,7 +92,10 @@ func (wfs *WFS) Rmdir(cancel <-chan struct{}, header *fuse.InHeader, name string
return fuse.Status(syscall.ENOTEMPTY)
}
dirFullPath := wfs.inodeToPath.GetPath(header.NodeId)
dirFullPath, code := wfs.inodeToPath.GetPath(header.NodeId)
if code != fuse.OK {
return
}
entryFullPath := dirFullPath.Child(name)
glog.V(3).Infof("remove directory: %v", entryFullPath)