tree structured fs cache

FsCache for FsNode, wrapping fs.Node
This commit is contained in:
Chris Lu
2020-03-26 00:08:14 -07:00
parent 2e4fadd10a
commit 7f0d87b206
10 changed files with 150 additions and 69 deletions

View File

@@ -13,18 +13,19 @@ import (
func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirectory fs.Node) error {
newPath := util.NewFullPath(newDir.Path, req.NewName)
oldPath := util.NewFullPath(dir.Path, req.OldName)
newDir := newDirectory.(*Dir)
newPath := util.NewFullPath(newDir.FullPath(), req.NewName)
oldPath := util.NewFullPath(dir.FullPath(), req.OldName)
glog.V(4).Infof("dir Rename %s => %s", oldPath, newPath)
err := dir.wfs.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
request := &filer_pb.AtomicRenameEntryRequest{
OldDirectory: dir.Path,
OldDirectory: dir.FullPath(),
OldName: req.OldName,
NewDirectory: newDir.Path,
NewDirectory: newDir.FullPath(),
NewName: req.NewName,
}