SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
mount: reuse previous file node
Chris Lu09f4ceef3a5b
diff --git a/weed/filesys/dir_rename.go b/weed/filesys/dir_rename.goindex 1bd1a6470e..8db879d2c9 100644--- a/weed/filesys/dir_rename.go+++ b/weed/filesys/dir_rename.go@@ -35,8 +35,9 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirector})if err == nil {+ newPath := filer2.NewFullPath(newDir.Path, req.NewName)oldPath := filer2.NewFullPath(dir.Path, req.OldName)- dir.wfs.cacheDelete(filer2.NewFullPath(newDir.Path, req.NewName))+ dir.wfs.cacheDelete(newPath)dir.wfs.cacheDelete(oldPath)oldFileNode := dir.wfs.getNode(oldPath, func() fs.Node {@@ -45,14 +46,17 @@ func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirectornewDirNode := dir.wfs.getNode(filer2.FullPath(dir.Path), func() fs.Node {return nil})- if oldFileNode != nil {+ dir.wfs.forgetNode(newPath)+ dir.wfs.forgetNode(oldPath)+ if oldFileNode != nil && newDirNode != nil {oldFile := oldFileNode.(*File)oldFile.Name = req.NewName- if newDirNode != nil {- oldFile.dir = newDirNode.(*Dir)- }+ oldFile.dir = newDirNode.(*Dir)+ dir.wfs.getNode(newPath, func() fs.Node {+ return oldFile+ })+}- dir.wfs.forgetNode(oldPath)}return err